Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Sep 2017 14:12:56 +0930
From:      "O'Connor, Daniel" <darius@dons.net.au>
To:        Russell Haley <russ.haley@gmail.com>
Cc:        freebsd-arm <freebsd-arm@freebsd.org>
Subject:   Re: Why does this compile?
Message-ID:  <43AA1F17-397E-489F-967B-FB69C7E3BF5D@dons.net.au>
In-Reply-To: <CABx9NuSzSzK87WF07S0B2aZpddKxYJf69kR2gWqBmHxaEQO6JA@mail.gmail.com>
References:  <CABx9NuSzSzK87WF07S0B2aZpddKxYJf69kR2gWqBmHxaEQO6JA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

> On 26 Sep 2017, at 14:08, Russell Haley <russ.haley@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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?43AA1F17-397E-489F-967B-FB69C7E3BF5D>