]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
tests: fix test 1167 to skip digit-only symbols
authorViktor Szakats <commit@vsz.me>
Mon, 13 May 2024 20:45:56 +0000 (22:45 +0200)
committerViktor Szakats <commit@vsz.me>
Tue, 14 May 2024 07:58:34 +0000 (09:58 +0200)
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

tests/test1167.pl

index a3a39d420ff537aa73d5f596ca8fe5bd72d85363..82c05d61aac359463d52709ca49e4789f876c1cb 100755 (executable)
@@ -104,6 +104,7 @@ sub scanenums {
                ($_ ne "typedef") &&
                ($_ ne "enum") &&
                ($_ ne "=") &&
+               ($_ !~ /^\d+$/) &&
                ($_ !~ /^[ \t]*$/)) {
                 if($verbose) {
                     print "Source: $Cpreprocessor $i$file\n";