|author||Rich Felker <firstname.lastname@example.org>||2012-05-09 11:47:06 -0400|
|committer||Rich Felker <email@example.com>||2012-05-09 11:47:06 -0400|
omit declaration of basename wrongly interpreted as prototype in C++
the non-prototype declaration of basename in string.h is an ugly compromise to avoid breaking 2 types of broken software: 1. programs which assume basename is declared in string.h and thus would suffer from dangerous pointer-truncation if an implicit declaration were used. 2. programs which include string.h with _GNU_SOURCE defined but then declare their own prototype for basename using the incorrect GNU signature for the function (which would clash with a correct prototype). however, since C++ does not have non-prototype declarations and interprets them as prototypes for a function with no arguments, we must omit it when compiling C++ code. thankfully, all known broken apps that suffer from the above issues are written in C, not C++.
Diffstat (limited to 'include/sys/param.h')
0 files changed, 0 insertions, 0 deletions