Why does this compile?

O'Connor, Daniel darius at dons.net.au
Tue Sep 26 04:59:09 UTC 2017


> On 26 Sep 2017, at 14:08, Russell Haley <russ.haley at gmail.com> wrote:
> This compiles on FreeBSD current and apparently on 11 too. That's a
> bad thing because it's supposed to fail. I checked in.h and there is
> no struct for in_pktinfo. Not surprisingly, if I remove the include
> altogether, it still compiles.
> 
> I assume then that the original author made a mistake? My C is too
> weak and most of my searches don't turn up anything close to what I'm
> looking for.
> 
> Any suggestions would be awesome.  :)

Change the test to..
check_c_source_compiles(
   "
   #include <${SOCKET_INCLUDES}>
   int main()
   {
       struct in_pktinfo teststruct;
       return 0;
   }
   "
   HAVE_IN_PKTINFO)

i.e. the original test is broken and will always compile (as you discovered).

--
Daniel O'Connor
"The nice thing about standards is that there
are so many of them to choose from."
 -- Andrew Tanenbaum
GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C



More information about the freebsd-arm mailing list