tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: [PATCH] Make more of stdlib.h visible if _NETBSD_SOURCE isn't defined



On Mon, Aug 31, 2020 at 12:38:57AM +0000, Taylor R Campbell wrote:
> > Date: Mon, 31 Aug 2020 00:25:52 +0000
> > From: maya%NetBSD.org@localhost
> > 
> > The following script fails to compile, it shouldn't.
> > 
> > #!/bin/sh
> > 
> > cat << EOF > test.c
> > #include <stdlib.h>
> > #include <stdio.h>
> >  
> > void f1(void)
> > {
> >     puts("pushed first");
> >     fflush(stdout);
> > }
> >  
> > void f2(void)
> > {
> >     puts("pushed second");
> > }
> >  
> > int main(void)
> > {
> >     at_quick_exit(f1);
> >     at_quick_exit(f2);
> >     quick_exit(0);
> > }
> > EOF
> > cc test.c -std=c11 -Werror
> 
> Works for me?
> 
> % cat << EOF > test.c
> ...
> EOF
> % cc test.c -std=c11 -Werror
> % ./a.out
> pushed second
> pushed first
> % 

Argh, I am trying to come up with examples while juggling these changes
in my actual /usr/include.

Very tempted to just settle for sprinkling #undef's in random projects
instead.


Home | Main Index | Thread Index | Old Index