Wireshark fails to compile with -WC++-compat on smi.h: In file included from epan.c:63: /usr/local/include/smi.h:319:1: error: empty struct has size 0 in C, size 1 in C++ [-Werror,-Wc++-compat] Fix: In smi.h: /* SmiElement -- an item in a list (row index column, notification object) */ typedef struct SmiElement { +#ifdef __clang__ + char dummy; /* CLANG complains about this with -WC++-compat */ +#endif #ifndef __GNUC__ char dummy; /* many compilers are unhappy with empty structures. */ #endif /* no visible attributes */ } SmiElement;
Maintainer of net-mgmt/libsmi, Please note that PR ports/186219 has just been submitted. If it contains a patch for an upgrade, an enhancement or a bug fix you agree on, reply to this email stating that you approve the patch and a committer will take care of it. The full text of the PR can be found at: http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/186219 -- Edwin Groothuis via the GNATS Auto Assign Tool edwin@FreeBSD.org
State Changed From-To: open->feedback Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
On Wed, 29 Jan 2014, Edwin Groothuis wrote: > Maintainer of net-mgmt/libsmi, > > Please note that PR ports/186219 has just been submitted. > > If it contains a patch for an upgrade, an enhancement or a bug fix > you agree on, reply to this email stating that you approve the patch > and a committer will take care of it. Thanks, there is a fix in the SVN already, ===> Generating patch ===> Viewing diff with more diff -ruN --exclude=CVS /usr/ports/net-mgmt/libsmi.orig/Makefile /usr/ports/net-mgmt/libsmi/Makefile --- /usr/ports/net-mgmt/libsmi.orig/Makefile 2014-01-29 17:15:07.000000000 +0100 +++ /usr/ports/net-mgmt/libsmi/Makefile 2014-01-29 17:19:09.000000000 +0100 @@ -3,6 +3,7 @@ PORTNAME= libsmi PORTVERSION= 0.4.8 +PORTREVISION= 1 CATEGORIES= net-mgmt MASTER_SITES= ftp://ftp.ibr.cs.tu-bs.de/pub/local/libsmi/ \ LOCAL/bms diff -ruN --exclude=CVS /usr/ports/net-mgmt/libsmi.orig/files/patch-cppcompat /usr/ports/net-mgmt/libsmi/files/patch-cppcompat --- /usr/ports/net-mgmt/libsmi.orig/files/patch-cppcompat 1970-01-01 01:00:00.000000000 +0100 +++ /usr/ports/net-mgmt/libsmi/files/patch-cppcompat 2014-01-29 17:15:07.000000000 +0100 @@ -0,0 +1,32 @@ +--- lib/smi.h.in.orig 2008-04-18 14:56:31.000000000 +0200 ++++ lib/smi.h.in 2014-01-29 17:11:40.000000000 +0100 +@@ -312,9 +312,10 @@ + + /* SmiElement -- an item in a list (row index column, notification object) */ + typedef struct SmiElement { +-#ifndef __GNUC__ +- char dummy; /* many compilers are unhappy with empty structures. */ +-#endif ++ char dummy; /* C99 does not allow empty structs; some compilers ++ accept them (gcc) but there are size differences ++ between C and C++. So for portability reasons, ++ we have this unused struct member. */ + /* no visible attributes */ + } SmiElement; + +--- lib/smi.h.orig 2008-04-18 14:58:06.000000000 +0200 ++++ lib/smi.h 2014-01-29 17:11:59.000000000 +0100 +@@ -312,9 +312,10 @@ + + /* SmiElement -- an item in a list (row index column, notification object) */ + typedef struct SmiElement { +-#ifndef __GNUC__ +- char dummy; /* many compilers are unhappy with empty structures. */ +-#endif ++ char dummy; /* C99 does not allow empty structs; some compilers ++ accept them (gcc) but there are size differences ++ between C and C++. So for portability reasons, ++ we have this unused struct member. */ + /* no visible attributes */ + } SmiElement; + ===> Done
Seems that this report is obsolete, libsmi is building everywhere: http://portsmon.freebsd.org/portoverview.py?category=net-mgmt&portname=libsmi Feel free to report this PR if I read this wrong.
btw, wireshark is also building everywhere: http://portsmon.freebsd.org/portoverview.py?category=net&portname=wireshark
Please note that this issue pops up again when compiling the head version of Wireshark, not the active one. I've just shot a similar fix to the maintainers of libsmi. Please consider committing the patch file.
Thanks, will check it out.
Another year have passed, I close here again during the maintainer timeout.