Skip to content

Commit

Permalink
setup.py: Explicilty use C99 for preprocessing
Browse files Browse the repository at this point in the history
GCC 15 uses -std=c23 by default, which causes pycparser to error out
with "pycparser.plyparser.ParseError:
/usr/lib/gcc/x86_64-pc-linux-gnu/15/include/stddef.h:450:31:
before: nullptr_t". As pcyparser only supports completely C99,
this shouldn't be an issue.

Signed-off-by: Christopher Byrne <[email protected]>
  • Loading branch information
salahcoronya committed Dec 15, 2024
1 parent e35ba5d commit f2e723c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,14 +189,15 @@ def get_mappings(self):
pdata = preprocess_file(
header_path,
cpp_args=[
"-std=c99",
"-D__builtin_va_list=char*",
"-D__extension__=",
"-D__attribute__(x)=",
],
)
else:
pdata = preprocess_file(
header_path, cpp_args=["-D__extension__=", "-D__attribute__(x)="]
header_path, cpp_args=["-std=c99", "-D__extension__=", "-D__attribute__(x)="]
)
parser = c_parser.CParser()
ast = parser.parse(pdata, "tss2_tpm2_types.h")
Expand All @@ -218,6 +219,7 @@ def get_mappings(self):
pdata = preprocess_file(
policy_header_path,
cpp_args=[
"-std=c99",
"-D__builtin_va_list=char*",
"-D__extension__=",
"-D__attribute__(x)=",
Expand All @@ -229,6 +231,7 @@ def get_mappings(self):
pdata = preprocess_file(
policy_header_path,
cpp_args=[
"-std=c99",
"-D__extension__=",
"-D__attribute__(x)=",
"-D__float128=long double",
Expand Down

0 comments on commit f2e723c

Please sign in to comment.