Skip to content

Remove warnings c compiler#789

Merged
guillep merged 8 commits intopharo-project:pharo-10from
PalumboN:remove-warnings-c-compiler
May 2, 2024
Merged

Remove warnings c compiler#789
guillep merged 8 commits intopharo-project:pharo-10from
PalumboN:remove-warnings-c-compiler

Conversation

@PalumboN
Copy link
Collaborator

@PalumboN PalumboN commented Apr 30, 2024

Bye flags for warnings:

  • -Wno-conditional-type-mismatch
  • -Wno-incompatible-pointer-types

And fixing other warnings from C compiler

@PalumboN PalumboN requested a review from guillep April 30, 2024 15:45
@PalumboN PalumboN added the dojo Things developed on VM Dojos label Apr 30, 2024
Comment on lines -2309 to +2313
return ((isBytes(socketOop))
&& ((byteSizeOf(socketOop)) == (sizeof(SQSocket)))
? ((SocketPtr) (firstIndexableField(socketOop)))
: (primitiveFailFor(PrimErrBadArgument),
null));
if ((isBytes(socketOop)) && ((byteSizeOf(socketOop)) == (sizeof(SQSocket)))) {
return (SocketPtr) (firstIndexableField(socketOop));
}
primitiveFailFor(PrimErrBadArgument);
return null;
Copy link
Member

Choose a reason for hiding this comment

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

Why would this rewrite remove the warning? do you know?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Because there is not the expression with the complex type I guess (split into many statements)

<var: #theFP type: #'char *'>
<var: #thePage type: #'StackPage *'>
<var: #theSP type: #'char *'>
<returnTypeC: #sqInt>
Copy link
Member

Choose a reason for hiding this comment

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

Oh yes :)

Is this a problem with the type inferencer? Something worth improving there as a separate issue?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's not just the type inferer, the problem is to have char* types in pointers to the stack (the type inference is doing good it's work).

I already opened an issue for that.

Copy link
Member

@guillep guillep left a comment

Choose a reason for hiding this comment

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

LGTM!

@guillep guillep merged commit bd07089 into pharo-project:pharo-10 May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dojo Things developed on VM Dojos

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants