Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Sep 2017 00:55:11 -0400
From:      George Mitchell <george+freebsd@m5p.com>
To:        freebsd-arm@freebsd.org
Subject:   Re: Why does this compile?
Message-ID:  <2b4d4179-9bda-c4ab-95af-5200463600cb@m5p.com>
In-Reply-To: <CABx9NuSzSzK87WF07S0B2aZpddKxYJf69kR2gWqBmHxaEQO6JA@mail.gmail.com>
References:  <CABx9NuSzSzK87WF07S0B2aZpddKxYJf69kR2gWqBmHxaEQO6JA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--chU1Pmv4FMIEBLRtL4DLfkWQ19nHDOQdt
Content-Type: multipart/mixed; boundary="97LRdo9QePb0oTx6t3RmG0uqkkASoxVsT";
 protected-headers="v1"
From: George Mitchell <george+freebsd@m5p.com>
To: freebsd-arm@freebsd.org
Message-ID: <2b4d4179-9bda-c4ab-95af-5200463600cb@m5p.com>
Subject: Re: Why does this compile?
References: <CABx9NuSzSzK87WF07S0B2aZpddKxYJf69kR2gWqBmHxaEQO6JA@mail.gmail.com>
In-Reply-To: <CABx9NuSzSzK87WF07S0B2aZpddKxYJf69kR2gWqBmHxaEQO6JA@mail.gmail.com>

--97LRdo9QePb0oTx6t3RmG0uqkkASoxVsT
Content-Type: text/plain; charset=utf-8
Content-Language: en-US
Content-Transfer-Encoding: quoted-printable

On 09/26/17 00:38, Russell Haley wrote:
> [...]
> #include <netinet/in.h>
>=20
> int main()
> {
>     struct in_pktinfo;
>     return 0;
> }
> [...]

This is a perfectly valid forward declaration of a struct type.  In
most normal cases, you would follow this up with something that contains
a pointer to a thing of that type, and later a full declaration of the
type.  As it stands, though, it's simply a statement to the compiler
that you are possibly using (and fully declaring) the structure type
later on in your program.                                 -- George


--97LRdo9QePb0oTx6t3RmG0uqkkASoxVsT--

--chU1Pmv4FMIEBLRtL4DLfkWQ19nHDOQdt
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEENdM4ZHktsJW5kKZXwRES3m+p4fkFAlnJ3bYACgkQwRES3m+p
4fnZww//bc8w36PcQw0KJeZ6a8DjSGuJ6bhNEJ7wT17Eb8+68mk2re5No8yYPXc0
LbvM1BSYlNbk3nyhgfVo5exGC22B2rqzQu4Qgr/bNc7J8z0yNGJIwS0UorKy6P02
yHCVwVLoPRMjoD/jdYCNd+j5qJ0lVnvcny39uGg1y2o4KsCRG6L+IwmPGLyvwViP
iJBcGuewmxc2BU0U+gxrq3Cw9uZTo5YYDBrc1hmre5S7pwBF94LgrFuFQVVGWOxH
GQAtBE4lEVsfjnahFgixbisA3cPlmFRjdBNW22kOg0H7F92ixHRbSYwLLHjZB3pN
NBR7BDlqWF5EfjhjJiz/jolFanta8XKB1QxuT1uDxPx48BnvuTpDwuYLkNJXObxE
TMbnldrRso2Bj4fAWNNyiFF6v/Jt4wH3TfrrzqM6D1J8DK/adiUrdSYPVIBIVMTf
uvp+kRidaS6DIywLeQexCZXgacgB6Kzy0DLWtS64k/jAYVkb57wU89t2bb4T86JL
FiZFx901j5KZiWX3BZaI9bNzB6+1ppnkUZmxZeguxjXNLEqZOFDH4fXP0TjX76XA
fIDmo1dlx/KuSgEmChduQAPjx9/dKFOkifqgYPkThNCH2wgNV+0qQ47+Ajrod+RX
KC/6GdRyxhN53T3FQ+WyPfyTL2+9QgpIe19Xs4zsa24zhXK9WIE=
=dpHX
-----END PGP SIGNATURE-----

--chU1Pmv4FMIEBLRtL4DLfkWQ19nHDOQdt--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?2b4d4179-9bda-c4ab-95af-5200463600cb>