then we need to check the standard if it needs SA_ONSTACK exposed and if so change our headers. The tests should not really need to define _NETBSD_SOURCE defined to compile.
christos > On May 14, 2016, at 9:18 PM, Charles Cui <charles.cui1...@gmail.com> wrote: > > let's call this small program as test.c. > > There is no problem when executing the command gcc test.c, > > However, when executing as gcc test.c -D_POSIX_C_SOURCE=200112L, it reports > SA_ONSTACK is not declared. > > _POSIX_C_SOURCE is enabled by default in the benchmark suite. > > If you guys think this flag is not necessary for us, then problem is solved. > > > > 2016-05-13 6:43 GMT-07:00 Christos Zoulas <chris...@zoulas.com>: > >> On May 12, 9:50pm, charles.cui1...@gmail.com (Charles Cui) wrote: >> -- Subject: Re: refine of the GSOC project >> >> | Well, your saying of _NETBSD_SOURCE is defined by default seems correct, >> | I compiled a file in the benchmark separately which has the problem of >> | accessing >> | macro SA_ONSTACK >> | <http://nxr.netbsd.org/source/s?refs=SA_ONSTACK&project=src> which lives >> | in <signal.h>. There is no problem in executing. >> | However, I am still not convinced why _NETBSD_SOURCE does not take effect >> | in the benchmark execution? There is no #undef _NETBSD_SOURCE in the >> | benchmark, >> | also defining other macros will not affect _NETBSD_SOURCE (it will make >> | multiple macros >> | exist simultaneously). I am not quite clear why the default _NETBSD_SOURCE >> | does not >> | work in the benchmark. >> | >> | this is from <signal.h>, benchmark using SA_ONSTACK reporting this macro >> | not found. >> | >> >> Why do you say that? Just compile and run this: >> >> #include <signal.h> >> #include <stdio.h> >> >> int >> main(void) >> { >> printf("%#x\n", SA_ONSTACK); >> return 0; >> } >> >> christos > > <sanitizer.log>