[Bug 216590] clang 3.9.1 from (e.g.) head -r312942 fails to reject or even warn about some forms of assignments to const fields

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Mon Jan 30 01:12:55 UTC 2017


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

            Bug ID: 216590
           Summary: clang 3.9.1 from (e.g.) head -r312942 fails to reject
                    or even warn about some forms of assignments to const
                    fields
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: freebsd-bugs at FreeBSD.org
          Reporter: markmi at dsl-only.net

clang 3.9.1 in FreeBSD allows the
following to compile without
complaint, even with -Wpedantic :

struct mlx5_core_diagnostics_entry {
    const char           *const desc;
          unsigned short        counter_id;
} empty;

int main ()
{
    struct mlx5_core_diagnostics_entry test;
    test = empty;
}

amd64-gcc, by contrast, rejects the assignment
as an error.

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


More information about the freebsd-bugs mailing list