coreboot-kgpe-d16/util/sconfig
Werner Zeh ac14a40d0e util/sconfig: Fix compile error with older glibc-headers
In patch e29a6ac16a (util/sconfig: Add
commonlib/helpers.h) helpers.h has been added to the include-list.
In headers.h we have a definition for __unused:

On a host system environment where glibc-headers-2.12-1.212 is
installed, a file included by <sys/stat.h> called bits/stat.h have the
following content on line 105 and onwards:

	long int __unused[3];
where the mentioned part is part of the structure called struct stat.

If we include commonlib/helpers.h _before_ <sys/stat.h>, the symbol for
__unused will be defined by the preprocessor to be
'__attribute__((unused))', therefore the above mentioned structure member
will be expanded by the preprocessor to be
'long int __attribute__((unused))[3];', which is not a valid C syntax
and therefore produces a compile error for sconfig tool.

To handle this case we need to make sure commonlib/helpers.h is included
_after_ <sys/stat.h>. As the needed part of stat.h (which is
struct stat) is only used in main.c it is safe to move the include from
sconfig.h directly into main.c while taking care of the order.

Change-Id: I9e6960a318d3dd999e1e9c1df326d67094f3b5ce
Signed-off-by: Werner Zeh <werner.zeh@siemens.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/34236
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
2019-07-12 11:02:29 +00:00
..
Makefile.inc util/sconfig: Add commonlib/helpers.h 2019-07-10 10:18:13 +00:00
description.md
lex.yy.c_shipped sconfig: Add SMBIOS type 9 entries 2019-05-07 16:04:56 +00:00
main.c util/sconfig: Fix compile error with older glibc-headers 2019-07-12 11:02:29 +00:00
sconfig.h util/sconfig: Fix compile error with older glibc-headers 2019-07-12 11:02:29 +00:00
sconfig.l sconfig: Add SMBIOS type 9 entries 2019-05-07 16:04:56 +00:00
sconfig.tab.c_shipped sconfig: Add SMBIOS type 9 entries 2019-05-07 16:04:56 +00:00
sconfig.tab.h_shipped sconfig: Add SMBIOS type 9 entries 2019-05-07 16:04:56 +00:00
sconfig.y sconfig: Add SMBIOS type 9 entries 2019-05-07 16:04:56 +00:00