Skip to content

Conversation

@ziyao233
Copy link
Member

@ziyao233 ziyao233 commented May 22, 2025

Existence of types may vary between language versions. For example, bool is turned into a builtin type in C23, but is defined in stdbool.h only in pre-C23 specifications.

Let's specify the C dialect used by our main codebase, GNU C99, explicitly when checking for existence of types, to keep probed results aligned with configuration used for building.

Issue: #7493

Existence of types may vary between language versions. For example, bool
is turned into a builtin type in C23, but is defined in stdbool.h only
in pre-C23 specifications.

Let's specify the C dialet used by our main codebase, GNU C99,
explicitly when checking for existence of types, to keep probed results
aligned with configuration used for building.

Issue: DynamoRIO#7493
@ziyao233 ziyao233 requested a review from derekbruening May 23, 2025 02:46

if (UNIX) # unlikely to be an issue on Windows
# Check for uint, etc. typedef conflicts like on rhel3 (i#18)
# and set DR_DO_NOT_DEFINE_*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's specify the C dialet used by our main codebase, GNU C99, explicitly when checking for existence of types, to keep

spelling: dialect

# Note that for later gcc uint and ushort seem to be "soft typedefs":
# defined, but overridable: ?!?
set(CMAKE_ORIG_C_FLAGS "${CMAKE_C_FLAGS}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99")
Copy link
Contributor

@derekbruening derekbruening May 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the issue is that gnu99 is not passed everywhere, shouldn't we solve that? Adding this temporary gnu99 just for these checks does not seem the best approach. There is also no comment here explaining why we'd set a flag and then unset it so this going to be confusing to future readers without explanation.

@ziyao233 ziyao233 changed the title i#7493 GCC-15: Specify language dialet when checking type existence i#7493 GCC-15: Specify language dialect when checking type existence May 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants