Add <stdint.h> integer width macros
Florian Weimer
fweimer@redhat.com
Sun Mar 5 12:05:00 GMT 2017
On 03/05/2017 10:50 AM, Ovidiu M wrote:
> Hi Joseph,
>
> The new macro SIZE_WIDTH conflicts with a definition in one of my
> projects, breaking compilation (
> https://gitlab.com/o9000/tint2/issues/625 ) with gcc 7 (which IIUC is
> a pre-release version).
Removing _GNU_SOURCE is a workaround which will address many such issues.
> Could you please tell me if there is anything I can do about it, other
> than renaming that variable?
You can participate in glibc development. Current consensus here is
that _GNU_SOURCE should be adjusted in every release to reflect a
superset of all standards supported by glibc (where those standards do
not conflict). This does have its problems, and particularly reckless
ISO revisions might force the community to adopt.
Another option is to participate in the ISO standardization process and
explain to these people that new identifiers added to existing header
files should use some construct (such as a suitable prefix) to reduce
the risk of collisions. Or perhaps non-core standards should stop
patching existing header files altogether and add new ones, which would
also resolve the backwards compatibility issue.
At some point in the future, it is likely that switching to C++ will
also reduce such issues because C++ relies less heavily on macros, and
identifiers can be nested in namespaces. At present, this is not really
an option because the GNU C++ implementation (via libstdc++) relies on
_GNU_SOURCE.
Thanks,
Florian
More information about the Libc-alpha
mailing list