Age | Commit message (Collapse) | Author | Lines |
2018年10月16日 | restore attribute((const)) to pthread_self and errno location decls | Rich Felker | -0/+3 |
|
revert commit a603a75a72bb469c6be4963ed1b55fabe675fe15.
as a result of commit 1c84c99913bf1cd47b866ed31e665848a0da84a2 this is
now safe, assuming an interpretation of the somewhat-underspecified
attribute((const)) consistent with real-world usage.
|
2015年09月17日 | remove attribute((const)) from pthread_self and errno location decls | Rich Felker | -3/+0 |
|
this attribute was applied to pthread_self and the functions providing
the locations for errno and h_errno as an optimization; however, it is
subtly incorrect. as specified, it means the return value will always
be the same, which is not true; it varies per-thread.
this attribute also implies that the function does not depend on any
state, and that calls to it can safely be reordered across any other
code. however such reordering is unsafe for these functions: they
break when reordered before initialization of the thread pointer. such
breakage was actually observed when compiled by libfirm/cparser.
to some extent the reordering problem could be solved with strong
compiler barriers between the stages of early startup code, but the
specified meaning of of attribute((const)) is sufficiently strong that
a compiler would theoretically be justified inserting gratuitous calls
to attribute((const)) const functions at random locations (e.g. to
save the value in static storage for later use).
this reverts commit cbf35978a9870fb1f5c73a852c986d4fcca6c2d4.
|
2013年04月06日 | add support for program_invocation[_short]_name | Rich Felker | -0/+6 |
|
this is a bit ugly, and the motivation for supporting it is
questionable. however the main factors were:
1. it will be useful to have this for certain internal purposes
anyway -- things like syslog.
2. applications can just save argv[0] in main, but it's hard to fix
non-portable library code that's depending on being able to get the
invocation name without the main application's help.
|
2012年01月26日 | remove useless "extern" keywords in headers | Rich Felker | -1/+1 |
|
2011年06月06日 | use __attribute__((const)) for errno and pthread_self if __GNUC__ is defined | Rich Felker | -0/+3 |
|
this is not too ugly and should result in significant code size and
performance improvements for many programs.
|
2011年02月12日 | initial check-in, version 0.5.0 v0.5.0 | Rich Felker | -0/+18 |
|