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

Re: [PATCH 1/6] Add memory pool library

From
Andreas Ericsson <ae@op5.se>
Date
Jun 14, 2010, 14:44 UTC
Message-ID
<4C16403F.4040400@op5.se>
In-Reply-To
<AANLkTimtya1Ph5YjlFVAVpE2p4XOHvuaFAmsS4C0J5LH@mail.gmail.com>
On 06/14/2010 04:25 PM, Ramkumar Ramachandra wrote:
Show 21 quoted lines
> Hi Jonathan,
> 
> Jonathan Nieder wrote:
>>   #ifdef __GNUC__
>>   #define MAYBE_UNUSED __attribute__((__unused__))
>>   #else
>>   #define MAYBE_UNUSED
>>   #endif
> 
> You'd suggested this earlier, but I was looking more for something
> that we could use to mark some specific functions as unused instead of
> marking everything as unused in the generation macro. Anyway, I have a
> patch ready, and svn-fe compiles fine with -Wall -Werror.
> 
>> Could that work here?
>>
>> The “unused” attribute was added in gcc 2.7.
> 
> Junio? Is this a good solution, or should we think of something else?
> What about other compilers?
> 

__attribute__((stuff)) is gcc-specific. It's usually macro'd away with #ifndef __GNUC__ #define __attribute__(x) #endif which is why it requires double parantheses. gcc warns for but doesn't fail on unknown attributes, so it should be safe to use this with gcc older than 2.7 as well. Or you make it conditional to __GNUC__ being >= 2 and __GNUC_MINOR__ being >= 7.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

Considering the successes of the wars on alcohol, poverty, drugs and
terror, I think we should give some serious thought to declaring war
on peace.
Previous: Ramkumar RamachandraNext: Ramkumar Ramachandra
Message 5 of 19 in “Another attempt to get the SVN exporter merged”
  1. 0/6 Another attempt to get the SVN exporter mergedRamkumar Ramachandra, Jun 10, 2010
  2. 1/6 Add memory pool libraryRamkumar Ramachandra, Jun 10, 2010
  3. Jonathan NiederJun 12, 2010
  4. Ramkumar RamachandraJun 14, 2010
  5. Andreas EricssonJun 14, 2010
  6. 2/6 Add cpp macro implementation of treapsRamkumar Ramachandra, Jun 10, 2010
  7. 3/6 Add library for string-specific memory poolRamkumar Ramachandra, Jun 10, 2010
  8. Junio C HamanoJun 11, 2010
  9. Ramkumar RamachandraJun 14, 2010
  10. Junio C HamanoJun 14, 2010
  11. Ramkumar RamachandraJun 14, 2010
  12. David Michael BarrJun 14, 2010
  13. 4/6 Add stream helper libraryRamkumar Ramachandra, Jun 10, 2010
  14. 5/6 Add infrastructure to write revisions in fast-export formatRamkumar Ramachandra, Jun 10, 2010
  15. 6/6 Add SVN dump parserRamkumar Ramachandra, Jun 10, 2010
  16. Ramkumar RamachandraJun 10, 2010
  17. Jonathan NiederJun 12, 2010
  18. Ramkumar RamachandraJun 14, 2010
  19. Ramkumar RamachandraJun 10, 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.