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

unsigned modifier on __INT32_TYPE__ unsupported #35

Closed
aytey opened this issue Mar 11, 2021 · 3 comments
Closed

unsigned modifier on __INT32_TYPE__ unsupported #35

aytey opened this issue Mar 11, 2021 · 3 comments

Comments

@aytey
Copy link
Contributor

aytey commented Mar 11, 2021

GCC version:

gcc (SUSE Linux) 10.2.1 20201202 [revision e563687cf9d3d1278f45aaebd03e0f66531076c9]

clang version:

clang version 11.0.1

Output of gcc -Werror -Wall -Wextra -Wpedantic -pedantic -std=c11 -c $FNAME

(return code 0)

Output of clang -Werror -Wall -Wextra -Wpedantic -pedantic -std=c11 -c $FNAME

(return code 0)

Output of cnip $FNAME

llvm.c:0:24 error: expected `,' or `;' or `=' after declarator, got `uint32_t'
unsigned __INT32_TYPE__ uint32_t;
                        ^

(return code 0)

Content of file

unsigned __INT32_TYPE__ uint32_t;

psychec version

commit d10dc1ddfb7ea845f59274a4d6ca5d021ab31423
Author: Leandro T. C. Melo <LTCMELO@GMAIL.COM>
Date:   Tue Mar 9 21:18:30 2021 -0300

    fix postfixing on compound literal
@aytey
Copy link
Contributor Author

aytey commented Mar 22, 2021

I think this "goes away" if you use the preprocessor (see #40):

avj@platypus ~/clones/psychec/preprocessor/build$ cat /tmp/moo/b.c
unsigned __INT32_TYPE__ uint32_t;
avj@platypus ~/clones/psychec/preprocessor/build$ ./cnip /tmp/moo/b.c; echo $?
b.c:0:24 error: expected `,' or `;' or `=' after declarator, got `uint32_t'
unsigned __INT32_TYPE__ uint32_t;
                        ^

0
avj@platypus ~/clones/psychec/preprocessor/build$ ./cnip --cc-pp /tmp/moo/b.c; echo $?
0

@ltcmelo
Copy link
Owner

ltcmelo commented Nov 25, 2021

Yes, this is a predefined macro. I created a label for this kind of errors as there are probably other and it'll be good to quickly spot them.

@ltcmelo
Copy link
Owner

ltcmelo commented Jan 23, 2022

Fixed with #62 .

@ltcmelo ltcmelo closed this as completed Jan 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants