On Tue, 6 Aug 2024, Alejandro Colomar wrote: > - The tests seem to work as expected if I compile them manually, and > run (the one that should be run) as a normal program. The one that > should not be run also gives the expected diagnostics. > Can anyone give advice of why it's not running well under the test > suite?
You almost certainly want to specify dg-options in the tests rather than using the default "-ansi -pedantic" for gcc.dg. Next question for the specification, implementation and tests: how does this feature interact with the rules on external definitions (the contexts in which it's OK to refer to an identifier with internal or external linkage that's never defined - for example, a function, static or extern, with a declaration but no definition; see 6.9.1)? My expectation would be that the rules are analogous to those for sizeof and typeof: in the cases where this operator does not evaluate its operand, it's also OK to reference an identifier that's declared but not defined, but in the cases where the operand is evaluated, that's not OK. (See gcc.dg/c99-static-1.c for example tests of these rules for sizeof.) -- Joseph S. Myers josmy...@redhat.com