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

Clang warnings #84

Closed
wants to merge 7 commits into from
Closed

Clang warnings #84

wants to merge 7 commits into from

Conversation

zmughal
Copy link
Member

@zmughal zmughal commented Mar 18, 2015

No description provided.

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...
@coveralls
Copy link

Coverage Status

Coverage remained the same at 48.99% when pulling 4f05db5 on clang_warnings into b9be0ce on master.

@mohawk2
Copy link
Member

mohawk2 commented Mar 21, 2015

This branch was absolutely the right technique to use, and @zmughal has achieved brilliant things with Travis. His rebasing of this work onto that other branch (in #86) renders this PR now obsolete, so I am closing it and deleting the branches.

@mohawk2 mohawk2 closed this Mar 21, 2015
@mohawk2 mohawk2 deleted the clang_warnings branch March 21, 2015 14:27
wchristian pushed a commit that referenced this pull request Sep 13, 2016
These were nearly all of the changes in spelling-errors.patch, part
of sf.net patch #84.  Not wanting to change history, I did not apply
the patches to Changes_CVS or to Changes.
wchristian pushed a commit that referenced this pull request Sep 13, 2016
Part of SF.net patch #84 from Debian: doc_dirlist.patch fixes
https://bugs.debian.org/681937: "pure-perl PDL module docs not
scanned on install".
wchristian pushed a commit that referenced this pull request Sep 13, 2016
This is patch 'manpage-has-bad-whatis-entry.patch' from SF.net
patch #84 from Debian.
wchristian pushed a commit that referenced this pull request Sep 13, 2016
SF.net patch #84 from Debian (doc_vendor_install.patch)
wchristian pushed a commit that referenced this pull request Sep 13, 2016
SF.net patch #84 from Debian, pdl-cppflags.patch.
wchristian pushed a commit that referenced this pull request Sep 13, 2016
SF.net patch #84 for Debian, patch dumper_gnukfreebsd.patch.

'gnukfreebsd' was assumed as a bsd userland, which
disabled/broke calls to 'uuencode' and 'uudecode'.
wchristian pushed a commit that referenced this pull request Sep 13, 2016
SF.net patch #84 from Debian (sorted_output.patch).

I changed it slightly from the submitted patch so that the calls
to 'sort' were on the results of 'values %hash' and not on the
result of 'map {$_->get_<whatever>} values %hash'. Merely a
stylistic preference.
wchristian pushed a commit that referenced this pull request Sep 13, 2016
SF.net patch #84, from Debian. This is part of the changeset from
reproducible-build.patch (the second one). Also partially addresses
https://bugs.debian.org/829365. Basically any time there is a
'keys %hash' or 'values %hash' in generating code, apply a 'sort'
before it. The rest of the patch is in the next commit.
wchristian pushed a commit that referenced this pull request Sep 13, 2016
Related to SF.net patch #84 from Debian (reproducibile-build.patch)
but instead of sorting the keys of PDL datatypes lexigraphically,
using PDL::Types::typesrtkeys() sorts them in order of complexity.
Satisfies the goals of reproducible builds but does it in a way
that makes more sense for PDL in this case.
wchristian pushed a commit that referenced this pull request Sep 21, 2016
These were nearly all of the changes in spelling-errors.patch, part
of sf.net patch #84.  Not wanting to change history, I did not apply
the patches to Changes_CVS or to Changes.
wchristian pushed a commit that referenced this pull request Sep 21, 2016
Part of SF.net patch #84 from Debian: doc_dirlist.patch fixes
https://bugs.debian.org/681937: "pure-perl PDL module docs not
scanned on install".
wchristian pushed a commit that referenced this pull request Sep 21, 2016
This is patch 'manpage-has-bad-whatis-entry.patch' from SF.net
patch #84 from Debian.
wchristian pushed a commit that referenced this pull request Sep 21, 2016
SF.net patch #84 from Debian (doc_vendor_install.patch)
wchristian pushed a commit that referenced this pull request Sep 21, 2016
SF.net patch #84 from Debian, pdl-cppflags.patch.
wchristian pushed a commit that referenced this pull request Sep 21, 2016
SF.net patch #84 for Debian, patch dumper_gnukfreebsd.patch.

'gnukfreebsd' was assumed as a bsd userland, which
disabled/broke calls to 'uuencode' and 'uudecode'.
wchristian pushed a commit that referenced this pull request Sep 21, 2016
SF.net patch #84 from Debian (sorted_output.patch).

I changed it slightly from the submitted patch so that the calls
to 'sort' were on the results of 'values %hash' and not on the
result of 'map {$_->get_<whatever>} values %hash'. Merely a
stylistic preference.
wchristian pushed a commit that referenced this pull request Sep 21, 2016
SF.net patch #84, from Debian. This is part of the changeset from
reproducible-build.patch (the second one). Also partially addresses
https://bugs.debian.org/829365. Basically any time there is a
'keys %hash' or 'values %hash' in generating code, apply a 'sort'
before it. The rest of the patch is in the next commit.
wchristian pushed a commit that referenced this pull request Sep 21, 2016
Related to SF.net patch #84 from Debian (reproducibile-build.patch)
but instead of sorting the keys of PDL datatypes lexigraphically,
using PDL::Types::typesrtkeys() sorts them in order of complexity.
Satisfies the goals of reproducible builds but does it in a way
that makes more sense for PDL in this case.
wchristian pushed a commit that referenced this pull request Sep 29, 2016
Added "see PDL::FAQ questions 6-10 and 6-11" to the croak
message for logical ops on multielement piddles.  Hope this
helps the users.
d-lamb pushed a commit that referenced this pull request Jan 19, 2019
These were nearly all of the changes in spelling-errors.patch, part
of sf.net patch #84.  Not wanting to change history, I did not apply
the patches to Changes_CVS or to Changes.
d-lamb pushed a commit that referenced this pull request Jan 19, 2019
Part of SF.net patch #84 from Debian: doc_dirlist.patch fixes
https://bugs.debian.org/681937: "pure-perl PDL module docs not
scanned on install".
d-lamb pushed a commit that referenced this pull request Jan 19, 2019
This is patch 'manpage-has-bad-whatis-entry.patch' from SF.net
patch #84 from Debian.
d-lamb pushed a commit that referenced this pull request Jan 19, 2019
SF.net patch #84 from Debian (doc_vendor_install.patch)
d-lamb pushed a commit that referenced this pull request Jan 19, 2019
SF.net patch #84 from Debian, pdl-cppflags.patch.
d-lamb pushed a commit that referenced this pull request Jan 19, 2019
SF.net patch #84 for Debian, patch dumper_gnukfreebsd.patch.

'gnukfreebsd' was assumed as a bsd userland, which
disabled/broke calls to 'uuencode' and 'uudecode'.
d-lamb pushed a commit that referenced this pull request Jan 19, 2019
SF.net patch #84 from Debian (sorted_output.patch).

I changed it slightly from the submitted patch so that the calls
to 'sort' were on the results of 'values %hash' and not on the
result of 'map {$_->get_<whatever>} values %hash'. Merely a
stylistic preference.
d-lamb pushed a commit that referenced this pull request Jan 19, 2019
SF.net patch #84, from Debian. This is part of the changeset from
reproducible-build.patch (the second one). Also partially addresses
https://bugs.debian.org/829365. Basically any time there is a
'keys %hash' or 'values %hash' in generating code, apply a 'sort'
before it. The rest of the patch is in the next commit.
d-lamb added a commit that referenced this pull request Jan 19, 2019
Related to SF.net patch #84 from Debian (reproducibile-build.patch)
but instead of sorting the keys of PDL datatypes lexigraphically,
using PDL::Types::typesrtkeys() sorts them in order of complexity.
Satisfies the goals of reproducible builds but does it in a way
that makes more sense for PDL in this case.
d-lamb pushed a commit that referenced this pull request Jan 19, 2019
Added "see PDL::FAQ questions 6-10 and 6-11" to the croak
message for logical ops on multielement piddles.  Hope this
helps the users.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants