bug#76816: Issues in testgluse.c

Jan Dubiec <[email protected]> Fri, 7 Mar 2025 15:22:54 +0100
Newsgroups gmane.comp.sysutils.dejagnu.bugs
Message-ID <[email protected]>
This is a multi-part message in MIME format.
--------------Kqh5XD75PAJIqh39o37j552c
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hello,

When I tried to run newlib tests on the GNU arm simulator, development version of gcc complained about a few issues in testgluse.c. The suggested patch is in the attachment.

Excerpt from the log:

Test run by jdx on Thu Mar  6 22:00:01 2025
Target is arm-unknown-eabi
Host   is x86_64-pc-linux-gnu

		=== newlib tests ===

Schedule of variations:
     arm-sim

Running target arm-sim
Using /usr/share/dejagnu/baseboards/arm-sim.exp as board description file for target.
Using /usr/share/dejagnu/config/sim.exp as generic interface file for target.
Using /usr/share/dejagnu/baseboards/basic-sim.exp as board description file for target.
Using /mnt/Works/testgcc/combosrc/newlib/testsuite/config/default.exp as tool-and-target-specific interface file.
Running /mnt/Works/testgcc/combosrc/newlib/testsuite/newlib.elix/elix.exp ...
Executing on host: /mnt/Works/testgcc/build-arm-linux/gcc/xgcc -B/mnt/Works/testgcc/build-arm-linux/gcc/    -c   -isystem /mnt/Works/testgcc/build-arm-linux/arm-eabi/./newlib/targ-include -isystem /mnt/Works/testgcc/combosrc/newlib/libc/include -o /mnt/Works/testgcc/build-arm-linux/arm-eabi/newlib/testsuite/testglue.o /usr/share/dejagnu/testglue.c    (timeout = 300)
spawn -ignore SIGHUP /mnt/Works/testgcc/build-arm-linux/gcc/xgcc -B/mnt/Works/testgcc/build-arm-linux/gcc/ -c -isystem /mnt/Works/testgcc/build-arm-linux/arm-eabi/./newlib/targ-include -isystem /mnt/Works/testgcc/combosrc/newlib/libc/include -o /mnt/Works/testgcc/build-arm-linux/arm-eabi/newlib/testsuite/testglue.o /usr/share/dejagnu/testglue.c
/usr/share/dejagnu/testglue.c: In function 'write_int':
/usr/share/dejagnu/testglue.c:67:1: warning: old-style function definition []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wno-old-style-definition-Wold-style-definition]8;;]
    67 | write_int(val, ptr)
       | ^~~~~~~~~
/usr/share/dejagnu/testglue.c: In function '__wrap_exit':
/usr/share/dejagnu/testglue.c:38:19: warning: old-style function definition []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wno-old-style-definition-Wold-style-definition]8;;]
    38 | #define ORIG_EXIT __wrap_exit
       |                   ^~~~~~~~~~~
/usr/share/dejagnu/testglue.c:85:1: note: in expansion of macro 'ORIG_EXIT'
    85 | ORIG_EXIT (code)
       | ^~~~~~~~~
/usr/share/dejagnu/testglue.c:32:19: error: too many arguments to function '__real_exit'; expected 0, have 1
    32 | #define REAL_EXIT __real_exit
       |                   ^~~~~~~~~~~
/usr/share/dejagnu/testglue.c:99:3: note: in expansion of macro 'REAL_EXIT'
    99 |   REAL_EXIT (code);
       |   ^~~~~~~~~
/usr/share/dejagnu/testglue.c:32:19: note: declared here
    32 | #define REAL_EXIT __real_exit
       |                   ^~~~~~~~~~~
/usr/share/dejagnu/testglue.c:51:13: note: in expansion of macro 'REAL_EXIT'
    51 | extern void REAL_EXIT ();
       |             ^~~~~~~~~
/usr/share/dejagnu/testglue.c: In function '__wrap__exit':
/usr/share/dejagnu/testglue.c:39:20: warning: old-style function definition []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wno-old-style-definition-Wold-style-definition]8;;]
    39 | #define ORIG__EXIT __wrap__exit
       |                    ^~~~~~~~~~~~
/usr/share/dejagnu/testglue.c:105:1: note: in expansion of macro 'ORIG__EXIT'
   105 | ORIG__EXIT (code)
       | ^~~~~~~~~~
/usr/share/dejagnu/testglue.c:34:20: error: too many arguments to function '__real__exit'; expected 0, have 1
    34 | #define REAL__EXIT __real__exit
       |                    ^~~~~~~~~~~~
/usr/share/dejagnu/testglue.c:120:3: note: in expansion of macro 'REAL__EXIT'
   120 |   REAL__EXIT (code);
       |   ^~~~~~~~~~
/usr/share/dejagnu/testglue.c:34:20: note: declared here
    34 | #define REAL__EXIT __real__exit
       |                    ^~~~~~~~~~~~
/usr/share/dejagnu/testglue.c:56:13: note: in expansion of macro 'REAL__EXIT'
    56 | extern void REAL__EXIT ();
       |             ^~~~~~~~~~
/usr/share/dejagnu/testglue.c: In function '__wrap_main':
/usr/share/dejagnu/testglue.c:41:19: warning: old-style function definition []8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wno-old-style-definition-Wold-style-definition]8;;]
    41 | #define ORIG_MAIN __wrap_main
       |                   ^~~~~~~~~~~
/usr/share/dejagnu/testglue.c:136:1: note: in expansion of macro 'ORIG_MAIN'
   136 | ORIG_MAIN (argc, argv, envp)
       | ^~~~~~~~~
compiler exited with status 1


Compiler version:

jdx@jdxpc:/mnt/Works/testgcc/build-arm-linux$ ./gcc/xgcc -v
Using built-in specs.
COLLECT_GCC=./gcc/xgcc
Target: arm-eabi
Configured with: ../combosrc/configure --prefix=/mnt/Works/testgcc/install-linux --target=arm-eabi --disable-werror --disable-nls --disable-threads --disable-tls --enable-checking=release --enable-languages=c --with-newlib --disable-multilib --enable-lto --disable-shared --enable-static --disable-libstdcxx-pch --without-libstdcxx-zoneinfo --with-system-zlib --with-pkgversion='GNU Toolchain for the ARM Architecture [Built by jdx]' --enable-tui --with-curses --enable-sim --with-expat
Thread model: single
Supported LTO compression algorithms: zlib
gcc version 15.0.1 20250227 (experimental) (GNU Toolchain for the ARM Architecture [Built by jdx])

Best regards,
Jan
--------------Kqh5XD75PAJIqh39o37j552c
Content-Type: text/plain; charset=UTF-8; name="testglue.c.patch"
Content-Disposition: attachment; filename="testglue.c.patch"
Content-Transfer-Encoding: base64

IHRlc3RnbHVlLmMgfCAyMiArKysrKysrLS0tLS0tLS0tLS0tLS0tCiAxIGZpbGUgY2hhbmdl
ZCwgNyBpbnNlcnRpb25zKCspLCAxNSBkZWxldGlvbnMoLSkKCmRpZmYgLS1naXQgYS90ZXN0
Z2x1ZS5jIGIvdG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kCi1PUklHX19FWElUIChjb2RlKQotICAgICBpbnQgY29kZTsKK09S
SUdfX0VYSVQgKGludCBjb2RlKQogewogICBjaGFyIGJ1ZlszMF07CiAgIGNoYXIgKnB0cjsK
QEAgLTEzMywxMCArMTI5LDcgQEAgT1JJR19BQk9SVCAoKQogCiAjaWZkZWYgUkVBTF9NQUlO
CiBpbnQKLU9SSUdfTUFJTiAoYXJnYywgYXJndiwgZW52cCkKLSAgICAgaW50IGFyZ2M7Ci0g
ICAgIGNoYXIgKiphcmd2OwotICAgICBjaGFyICoqZW52cDsKK09SSUdfTUFJTiAoaW50IGFy
Z2MsIGNoYXIgKiphcmd2LCBjaGFyICoqZW52cCkKIHsKICNpZmRlZiBXUkFQX0ZJTEVfQVJH
UwogICBleHRlcm4gaW50IF9fYXJnYzsKQEAgLTE1Miw4ICsxNDUsNyBAQCBPUklHX01BSU4g
KGFyZ2MsIGFyZ3YsIGVudnApCiAKICNpZmRlZiBWWFdPUktTCiB2b2lkCi1fZXhpdCAoc3Rh
dHVzKQotICAgICBpbnQgc3RhdHVzOworX2V4aXQgKGludCBzdGF0dXMpCiB7CiAgIFJFQUxf
RVhJVCAoc3RhdHVzKTsKIH0K

--------------Kqh5XD75PAJIqh39o37j552c
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline

X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KQnVnLWRlamFn
bnUgbWFpbGluZyBsaXN0CkJ1Zy1kZWphZ251QGdudS5vcmcKaHR0cHM6Ly9saXN0cy5nbnUub3Jn
L21haWxtYW4vbGlzdGluZm8vYnVnLWRlamFnbnUK

--------------Kqh5XD75PAJIqh39o37j552c--