Skip to content

Commit

Permalink
tests: fix test 1167 to skip digit-only symbols
Browse files Browse the repository at this point in the history
This avoids mistaking symbols with their numeric value when using
certain C preprocessors which output these numeric values at the
beginning of the line as part of an expression.

Seen on OpenBSD 7.5 + clang.

Example `test1167.pl -v` output, before this patch:
```
Source: cpp /home/runner/work/curl/curl/tests/../include/curl/curl.h
Symbol: 20000
Line #3835:   20000 +  142,
[...]
Bad symbols in public header files:
   20000
   [...]
```
Ref: https://github.com/curl/curl/actions/runs/9069136530/job/24918015357#step:3:7513

Ref: #13583
Closes #13634
  • Loading branch information
vszakats committed May 14, 2024
1 parent aef3698 commit 17e51d2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tests/test1167.pl
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ sub scanenums {
($_ ne "typedef") &&
($_ ne "enum") &&
($_ ne "=") &&
($_ !~ /^\d+$/) &&
($_ !~ /^[ \t]*$/)) {
if($verbose) {
print "Source: $Cpreprocessor $i$file\n";
Expand Down

0 comments on commit 17e51d2

Please sign in to comment.