Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Sat, 25 Aug 2012 22:33:39 -0400
From: Gregor Richards <>
Subject: Re: C11 low-hanging fruit

New version of the patch, per chat on IRC:
  * stdalign.h __GNUC__ test is simplified (since musl isn't going to 
work well on GCC<3.1 anyway)
  * feature test macros are simplified, aligned_alloc is unconditional
  * aligned_alloc is now the fundamental implementation, with 
posix_memalign in terms of it instead of the opposite
  * the check for 'x' in fopen is simplified, as well as the check for '+'

With valediction,
  - Gregor Richards

On 08/25/2012 09:42 PM, Gregor Richards wrote:
> Attached is a diff that adds the trivially-simple bits of C11. That 
> is, those that require changes to the standard headers, but very 
> little in the way of implementation. Included are:
>  * stdalign.h , including backwards compatibility for GCC.
>  * aligned_alloc
>  * fopen(..., "...x")
>  * conditional removal of gets
> Excluded are:
>  * threads.h (waiting to see glibc's ABI)
>  * stdatomic.h (complicated, probably has ABI implications too, not 
> even fully supported by GCC yet)
>  * uchar.h (this is MOSTLY trivial since musl's wchar is Unicode 
> anyway, but char32_t makes it a bit more than some weak aliases)
>  * at_quick_exit, quick_exit (I suspect that our benevolent dictator 
> will have a lot to say in exactly what makes an exit "quick" or not, 
> so I'm not touching this)
> I used __STDC_VERSION__ in the headers to control exposure of 
> aligned_alloc and gets. aligned_alloc I additionally exposed with the 
> non-standard feature test macro _ISOC11_SOURCE, for the simple reason 
> that glibc does it; if you have a non-C11 compiler but C11 libc, 
> -D_ISOC11_SOURCE is a much less gross way to get aligned_alloc than 
> -D_GNU_SOURCE, anyway :)
> With valediction,
>  - Gregor Richards

View attachment "c11-easy.diff" of type "text/x-diff" (4598 bytes)

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.