Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Mar 2019 14:32:11 +0000
From:      bugzilla-noreply@freebsd.org
To:        ports-bugs@FreeBSD.org
Subject:   [Bug 236784] lang/gcc8 wrong compiler error message on missing struct member
Message-ID:  <bug-236784-7788@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D236784

            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@FreeBSD.org
          Reporter: michaelbuch12@gmail.com
          Assignee: gerald@FreeBSD.org
             Flags: maintainer-feedback?(gerald@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

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-236784-7788>