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

Compiler warning: -Wno-pointer-integer-compare #790

Open
PalumboN opened this issue Apr 30, 2024 · 0 comments
Open

Compiler warning: -Wno-pointer-integer-compare #790

PalumboN opened this issue Apr 30, 2024 · 0 comments
Labels

Comments

@PalumboN
Copy link
Collaborator

These warnings are due comparison between pointers (most char *) and integers (most sqInt). For example:

generated/64/vm/src/gcc3x-cointerp.c:29031:31: 
warning: comparison between pointer and integer ('char *' and 'usqInt' (aka 'unsigned long')) [-Wpointer-integer-compare]
                if (GIV(instructionPointer) == (ceReturnToInterpreterPC())) {

It is because all the pointers to the stack are declared as char *... check the comment on this line:

"These are all pointers; char * because Slang has no support for C pointer arithmetic."
self declareC: #(instructionPointer stackPointer framePointer stackLimit breakSelector)
as: #'char *'
in: aCCodeGenerator.

The problem changing that line to #usqInt makes compilation errors.

@PalumboN PalumboN added the slang label Apr 30, 2024
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

1 participant