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
Travis compiler clang fix warnings #86
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is in order to test against compilers other than GCC. This fixes <#13>.
…PERL_MM_OPT `PERL_MM_OPT` does not work with Makefile.PLs in subdirectories. Running perl Makefile.PL CC=clang; find -name Makefile -exec grep -H '^CC =' {} \; shows that `CC = clang` in the toplevel Makefile, but `CC = cc` elsewhere.
All of these came from one line in Basic/Gen/PP.pm that used an assignment in a macro argument. But in the Perl macro cascade there is #defined HvAUX(hv), which uses its argument twice. This caused the assignment to happen twice. It was a harmless unintended consequence, but at least the warnings have gone away.
It used to be that you could call printf(buf), but now for security purposes it needs to be printf("%s",buf). Since Perl_croak just uses printf (I think), I just added "%s" to a single line in Dev.pm.
This is a bit nanny-ish, just asking for an extra set of parenthesis to make sure we understand the C operator precedence rules. We do.
This warning happens when you do an assignment in a conditional: if (a=something()). Compiler checks to make sure you didn't mean if (a==something()). Get around that by adding an extra set of parentheses around the assignment.
clang was complaining because the generated code turned out to be somthing like 'PDL_short foo = 0.25;' which is a type mismatch. 0.25 got rounded to 0 before assignment to PDL_short foo. This is actually what the cheesy test for floating-pointiness intended, so I suppressed that warning in the Makefile.PL. An alternative would be to have a type() look for integers and one for floating-point datatypes.
It's been a few decades since void was introduced...
This looks fine (and nice Travis work, @zmughal) - this looks like it should be merged. |
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Combines #85 and #84.