On 4/21/20 3:50 AM, Bernhard Reutner-Fischer wrote:
On 17 April 2020 21:21:41 CEST, Martin Sebor via Gcc-patches 
<gcc-patches@gcc.gnu.org> wrote:
On 4/17/20 11:48 AM, Alexandre Oliva wrote:
On Apr  9, 2020, Alexandre Oliva <ol...@adacore.com> wrote:

Some target C libraries that aren't recognized as freestanding don't
have filesystem support, so calling tmpnam, fopen/open and
remove/unlink fails to link.

This patch introduces a tmpnam effective target to the testsuite,
and
requires it in the tests that call tmpnam.

Tested on x86_64-linux-gnu, and with a cross to arm-eabi.
Ok to install?


for  gcc/testsuite/ChangeLog

        * lib/target-supports.exp (check_effective_target_tmpnam): New.
        * gcc.c-torture/execute/fprintf-2.c: Require it.
        * gcc.c-torture/execute/printf-2.c: Likewise.
        * gcc.c-torture/execute/user-printf.c: Likewise.

Ping?

https://gcc.gnu.org/pipermail/gcc-patches/2020-April/543672.html

I'm okay with the changes to the tests.

The target-supports.exp changes look reasonable to me as well but
I can't approve them.  Since you said it's for targets that don't
have file I/O functions I wonder if the name would better reflect
that if it were called, say, check_effective_target_fileio?

Since tmpnam is obsolescent in SUSv4 and hence a libc is fine to omit it, I'd 
rather fix the tests to use functions that are known to stay.

I would be okay with replacing tmpnam with something else, although
I don't think it's necessary.  tmpnam is a standard C function that
conforming C (and so POSIX) implementation are required to provide.

Martin


If you want a fileio predicate then please do not keys it off obsolescent 
functions.

TIA,

I don't expect it's necessary to worry about handling errors in
the .exp test.

Martin


Reply via email to