[Bug 236784] lang/gcc8 wrong compiler error message on missing struct member

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Mon Mar 25 14:32:14 UTC 2019


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=236784

            Bug ID: 236784
           Summary: lang/gcc8 wrong compiler error message on missing
                    struct member
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: gerald at FreeBSD.org
          Reporter: michaelbuch12 at gmail.com
          Assignee: gerald at FreeBSD.org
             Flags: maintainer-feedback?(gerald at FreeBSD.org)

I took this piece of code out of a a project I'm working on:

#include <string.h>
#include <unistd.h>
#include <netinet/in.h>
#include <netinet/ip.h>
#include <netinet/ip_icmp.h>

struct packet
{
        struct icmp hdr;
};

int main() {
        struct packet pckt;
        memset(&pckt.icmp_data, 0, 0);
        return 0;
}

When compiling this with gcc8 on FreeBSD 12.0-RELEASE I get following error:

bug.c: In function 'main':
bug.c:14:14: error: 'struct packet' has no member named 'icmp_dun'
  memset(&pckt.icmp_data, 0, 0);

gcc is correct in detecting an error since packet indeed has no member
"icmp_data" but the error message says "icmp_dun" which appears to come from
nowhere.

Unfortunately my only system right now is FreeBSD so couldn't check on other
OSes.

Thanks,
Michael

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-ports-bugs mailing list