[Patch] gcn/mkoffload.cc: Re-add fprintf for #include of stdlib.h/stdbool.h

Tobias Burnus tburnus@baylibre.com
Mon Sep 23 13:56:14 GMT 2024


Now committed as r15-3797-ga030fcad4f9f49 / 
https://gcc.gnu.org/r15-3797-ga030fcad4f9f49 as obvious.

Tobias

Am 21.09.24 um 00:52 schrieb Tobias Burnus:
> See attached patch for adding the include lines:
>
> +  if (gcn_stack_size)
> +    {
> +      fprintf (cfile, "#include <stdlib.h>\n");
> +      fprintf (cfile, "#include <stdbool.h>\n\n");
>
> but contrary to previously there is no 'stdint.h'
> and they are also not unconditionally included.
>
> (The 'stdbool.h' is only used for a single 'true', but on the other 
> hand it
> is only #included under this condition and 'stdbool.h' is a very 
> simple file.)
>
> I intent to apply this patch as obvious, unless there are further 
> comments.
>
> * * *
>
> Thomas Schwinge wrote:
>
>> I've not verified, but I very much suspect that this change: […]
>>>      gcn/mkoffload.cc: Use #embed for including the generated ELF file
>>> ... is responsible for: […]
>>      /tmp/ccHVeRbm.c:80:21: error: implicit declaration of function 
>> 'getenv' [-Wimplicit-function-declaration]
>> […] Did you not see that happen in your testing?
>
> I vaguely remember some fails in this area — but after digging and 
> re-testing, it did not show up, for whatever reason. As it only 
> triggers with -mstack-size, it somehow must have fallen through the 
> cracks. :-/


More information about the Gcc-patches mailing list