Page MenuHomeFreeBSD

Fix clang 3.5.0 warning in isa_defs.h
ClosedPublic

Authored by dim on Nov 18 2014, 6:23 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 24, 8:43 PM
Unknown Object (File)
Oct 22 2024, 8:16 AM
Unknown Object (File)
Oct 17 2024, 9:00 PM
Unknown Object (File)
Oct 4 2024, 6:01 AM
Unknown Object (File)
Oct 4 2024, 12:59 AM
Unknown Object (File)
Oct 3 2024, 9:38 PM
Unknown Object (File)
Oct 1 2024, 5:10 PM
Unknown Object (File)
Sep 21 2024, 2:08 PM
Subscribers

Details

Summary

Fix the following -Werror warning from clang 3.5.0, while building cddl/lib/libctf:

In file included from cddl/contrib/opensolaris/common/ctf/ctf_create.c:31:
In file included from sys/cddl/contrib/opensolaris/uts/common/sys/sysmacros.h:34:
sys/cddl/contrib/opensolaris/uts/common/sys/isa_defs.h:334:9: warning: '_ILP32' macro redefined [-Wmacro-redefined]
#define _ILP32
        ^
<built-in>:26:9: note: previous definition is here
#define _ILP32 1
        ^
1 warning generated.
Test Plan

Compile it with gcc, clang 3.4 and clang 3.5.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

dim retitled this revision from to Fix clang 3.5.0 warning in isa_defs.h.
dim updated this object.
dim edited the test plan for this revision. (Show Details)
dim added reviewers: avg, smh, delphij.
dim added a subscriber: emaste.

Seems reasonable to me.

Is the difference just that older Clang does not warn about defining a built-in macro with the same value? (I.e., _ILP32 is a built-in, in both Clang 3.4.2 and 3.5.)

Apparently clang 3.4.1 and 3.4.2 do not define _ILP32, while 3.5.0 defines both _ILP32 and ILP32 internally. It was added here: http://llvm.org/viewvc/llvm-project?view=revision&revision=212931

emaste added a reviewer: emaste.

Oh, interesting. I see that _LP64 and LP64 were already defined in 3.4.x, but not the corresponding 32-bit ones.

This revision is now accepted and ready to land.Nov 18 2014, 7:06 PM
avg edited edge metadata.

LGTM

smh edited edge metadata.

lgtm

markj edited edge metadata.
dim updated this revision to Diff 2454.

Closed by commit rS274697 (authored by @dim).