:: Re: [DNG] help with C - error: impl…
Etusivu
Poista viesti
Vastaa
Lähettäjä: Lorenz
Päiväys:  
Vastaanottaja: Rainer Weikusat
Kopio: dng
Aihe: Re: [DNG] help with C - error: implicit declaration of function
Hi,

Il giorno lun 29 lug 2024 alle ore 18:20 Rainer Weikusat via Dng
<dng@???> ha scritto:
>
> The real problem is that detecting availability of sigprocmask doesn't
> work. The code in the #else-branch should never be compiled on
> Linux.
>
>
> But working why
> sigprocmask isn't being detected and fixing that is the 'proper' way to
> handle this.


this was the right hint: it turns out that the logic to detect this is to
build some c code, discard all output and use the return code to
select the header. So in the case of sigprocmask in my system with
gcc-14 I have

./compile trysgprm.c
trysgprm.c:5:1: error: return type defaults to ‘int’ [-Wimplicit-int]
    5 | main()
      | ^~~~
and bsd code is selected.
The logic silently fails due to gcc14 turning warnings into errors
and wrong sections of the code are builded.
And there are also other try*.c that need a fix, I will look better at this
tomorrow.


many thanks,
Lorenzo