Re: Purpose of "struct object_entry *oe = oe;"?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Jun 29, 2010, at 5:28 AM, Bruce Stephens wrote:

Out of curiousity, where did this convention/idiom come from, and what's
it for?

I presume it's to remove a warning ("oe might be used uninitialised") on a compiler (or something) that's clever enough to attempt such analysis
but too stupid to notice that the supposed initialisation is using
something uninitialised (or perhaps the compiler's deliberately
recognising the convention?).  Is that right, or does it actually do
something more?

I'm mostly surprised that it surprises me. Is it used commonly in other
projects?  (It appears not to be mentioned in CodingGuidelines; should
it be?)

I was wondering this myself. My compiler complains in (and only in) the *presence* of this idiom, rather than its absence, so I undid it:

jj/warn/uninitialized branch on GitHub
http://github.com/jjuran/git/tree/jj/warn/uninitialized

jj/warn/uninitialized commit on GitHub
http://github.com/jjuran/git/commit/ 8affbf2d8e46fbd5f3d6898aa07ea8548432e7bc
Signed-Off-By:  Joshua Juran <jjuran@xxxxxxxxx> (or s/gmail/metamage/)

A compiler that warns of uninitialized usage *unless* a variable is initialized *with itself* is doubly broken.

Cheers,
Josh


--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]