Bug 503817 - 's390x: ordered comparison of pointer with integer zero' compiler warnings in test code
Summary: 's390x: ordered comparison of pointer with integer zero' compiler warnings in...
Status: RESOLVED FIXED
Alias: None
Product: valgrind
Classification: Developer tools
Component: general (other bugs)
Version First Reported In: 3.25 GIT
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Florian Krohm
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-05-06 01:16 UTC by correctmost
Modified: 2025-05-06 09:23 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description correctmost 2025-05-06 01:16:19 UTC
SUMMARY

GCC reports tskip_digitshe following warnings in none/tests/s390x/disasm-test/opcode.c:

opcode.c: In function ‘parse_int’:
opcode.c:1411:27: warning: ordered comparison of pointer with integer zero [-Wextra]
 1411 |    if (is_unsigned && val < 0) {
      |                           ^
opcode.c:1415:27: warning: ordered comparison of pointer with integer zero [-Wextra]
 1415 |    return skip_digits(val < 0 ? p + 1 : p);
      |                           ^

Looking at the code, it does seem like *val should be used instead.

SOFTWARE/OS VERSIONS

Commit 64beb80 compiled on Arch Linux
Comment 1 correctmost 2025-05-06 01:24:22 UTC
Sorry, I accidentally middle-clicked before submitting.

The "GCC reports tskip_digitshe" text should say "GCC reports the".  And the arrows in the compiler warnings should point to the < signs.
Comment 2 Florian Krohm 2025-05-06 07:24:49 UTC
Good catch! Thanks for the report.
We don't compile with -Wextra (except in a few testsuite buckets). But maybe we should consider it.
I'll take a look later today.
Comment 3 Florian Krohm 2025-05-06 09:23:59 UTC
Fixed in 685affd00645ea5d4492897d372e457bfc8cf838.

As for -Wextra.... the fallout is:
2948  warnings
  521  -Wsign-compare
1613  -Wunused-parameter
    44  -Wtype-limits
  747  -Wmissing-field-initializers
    17  -Wcast-function-type
      4  -Wclobbered
      2  -Wextra (as reported)

I sampled a few and none of those I'd want to fix. 
Might be worthwhile, though, to make a run with -Wextra as part of release festivities.