git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
BSBruce Stephens <bruce.stephens@isode.com>
Date
Jun 29, 2010, 12:28 UTC
Message-ID
<8039w681lo.fsf@tiny.isode.net>

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?)

(First instance in git that I can see is 67affd5173da059ca60aab7896985331acacd9b4, 2006.)

Next: Joshua Juran
Message 1 of 4 in “Purpose of "struct object_entry *oe = oe;"?”
  1. Bruce StephensJun 29, 2010
  2. Joshua JuranJul 2, 2010
  3. David AguilarJul 2, 2010
  4. Bruce StephensJul 2, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.