https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116757

            Bug ID: 116757
           Summary: check_effective_target_fileio uses deprecated function
                    resulting in UNSUPPORTED
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: testsuite
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rguenth at gcc dot gnu.org
  Target Milestone: ---

Tests like gcc.c-torture/execute/fprintf-2.c have a
dg-requires-effective-target  on fileio but with "recent" glibc the test

# Check to see that file I/O functions are available.
proc check_effective_target_fileio { } {
    return [check_no_compiler_messages fileio_available executable {
#include <stdio.h>
int main() {
    char *n = tmpnam (NULL);
    FILE *f = fopen (n, "w");
    fclose (f);
    remove (n);
    return 0;
} } ""]
}

results in

Executing on host: /home/rguenther/obj-riscv-g/gcc/xgcc
-B/home/rguenther/obj-riscv-g/gcc/ fileio_available24825.c  -march=rv64gcv  
-fdiagnostics-plain-output   -Wno-complain-wrong-lang  -lm  -o
fileio_available24825.exe    (timeout = 300)
spawn -ignore SIGHUP /home/rguenther/obj-riscv-g/gcc/xgcc
-B/home/rguenther/obj-riscv-g/gcc/ fileio_available24825.c -march=rv64gcv
-fdiagnostics-plain-output -Wno-complain-wrong-lang -lm -o
fileio_available24825.exe
/usr/bin/riscv64-suse-linux-ld: /tmp/ccU8OtI9.o: in function `main':
fileio_available24825.c:(.text+0xa): warning: the use of `tmpnam' is dangerous,
better use `mkstemp'
UNSUPPORTED: gcc.c-torture/execute/fprintf-2.c   -O0

this particular test uses gcc_tmpnam which could be modernized along the
effective target but cross-checking other users would be necessary.  I'm
not sure we can prune this specific message from the test and still get
using tests pass.

Reply via email to