Re: [systemd-devel] [PATCH] core: Remove unnecessary typedef
On Wed, Apr 17, 2013 at 6:08 PM, Henrik Grindal Bakken h...@ifi.uio.no wrote: ExecContext isn't used in this header file, and everything seems to build just fine without this typedef. The typedef doesn't really belong here, and at least my gcc-4.4.6 gives an error on type redefined. Weird, this type of forward-declaration is a common pattern. Applied. Thanks, Kay ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [PATCH] core: Remove unnecessary typedef
Kay Sievers k...@vrfy.org writes: On Wed, Apr 17, 2013 at 6:08 PM, Henrik Grindal Bakken h...@ifi.uio.no wrote: ExecContext isn't used in this header file, and everything seems to build just fine without this typedef. The typedef doesn't really belong here, and at least my gcc-4.4.6 gives an error on type redefined. Weird, this type of forward-declaration is a common pattern. A closer look reveals that gcc warns in gcc-4.4, but not in gcc-4.7. -- Henrik Grindal Bakken h...@ifi.uio.no PGP ID: 8D436E52 Fingerprint: 131D 9590 F0CF 47EF 7963 02AF 9236 D25A 8D43 6E52 ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [PATCH] core: Remove unnecessary typedef
On 17/04/13 17:25, Kay Sievers wrote: On Wed, Apr 17, 2013 at 6:08 PM, Henrik Grindal Bakken h...@ifi.uio.no wrote: ExecContext isn't used in this header file, and everything seems to build just fine without this typedef. The typedef doesn't really belong here, and at least my gcc-4.4.6 gives an error on type redefined. Weird, this type of forward-declaration is a common pattern. We had this bug in telepathy-glib too: typedef struct Xyz Xyz;, seen once per translation unit, is fine. typedef struct Xyz Xyz; typedef struct Xyz Xyz; was an error in C89 and C99, but is allowed in C11. The portable thing to do is to have the typedef in exactly one header file (which doesn't necessarily have to be the same one that declares the contents of a struct Xyz), and have everything else that mentions Xyz include that header. S ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel