Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UINT_MAX not expanded to typemax(Cuint) #288

Open
vchuravy opened this issue Apr 20, 2021 · 4 comments
Open

UINT_MAX not expanded to typemax(Cuint) #288

vchuravy opened this issue Apr 20, 2021 · 4 comments
Labels

Comments

@vchuravy
Copy link
Collaborator

vchuravy commented Apr 20, 2021

https://github.com/flux-framework/flux-core/blob/ed8a7d2f14320fa8b2d5f5377f117eceb205b065/src/common/libidset/idset.h#L32

got expanded to:

const IDSET_INVALID_ID = UINT_MAX - 1

on current master

@Gnimuc Gnimuc added the macro label May 8, 2021
@Gnimuc
Copy link
Member

Gnimuc commented May 8, 2021

This is possible if we also do a dependency analysis on those macro identifiers.

@Gnimuc Gnimuc added the good first issue Good for newcomers label May 8, 2021
@Gnimuc Gnimuc added this to the release-0.14.0 milestone May 13, 2021
@melonedo
Copy link
Contributor

melonedo commented Aug 8, 2021

It seems that UINT_MAX depends on __INT_MAX__, which is not defined in the headers. Maybe we have to add default macro definitions too.
https://stackoverflow.com/questions/58111142/where-is-the-macro-int-max-defined

@Gnimuc
Copy link
Member

Gnimuc commented Aug 8, 2021

For now, macros are skipped in the dependency searching for identifiers.

https://github.com/JuliaInterop/Clang.jl/blob/master/src/generator/macro.jl#L174-L179

In general, macro support is hard to be done in an elegant way with libclang. The main reason is libclang doesn't expose enough info about tokens.

I think we should not invest too much time in this. Once ClangCompiler.jl hits a good coverage rate of Clang API, we can make full use of Clang's parser/preprocessor/lexer API. As for the OSPP project, it's OK to ignore those macro-related goals.

@Gnimuc Gnimuc removed the good first issue Good for newcomers label Oct 13, 2021
@Gnimuc Gnimuc removed this from the release-0.14.0 milestone Oct 13, 2021
@JBlaschke
Copy link

I see the same for INT_MAX: #401

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants