LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 23482 - revision 236900 appears to break compilation on Solaris
Summary: revision 236900 appears to break compilation on Solaris
Status: RESOLVED FIXED
Alias: None
Product: libraries
Classification: Unclassified
Component: Support Libraries (show other bugs)
Version: trunk
Hardware: PC Solaris
: P normal
Assignee: Renato Golin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-11 13:02 PDT by Norm Jacobs
Modified: 2015-05-12 05:35 PDT (History)
2 users (show)

See Also:
Fixed By Commit(s):


Attachments
patch to workaround naming conflict between sys/time.h and TargetParser.h (479 bytes, patch)
2015-05-11 13:02 PDT, Norm Jacobs
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Norm Jacobs 2015-05-11 13:02:56 PDT
Created attachment 14310 [details]
patch to workaround naming conflict between sys/time.h and TargetParser.h

Changset 2369000 appears to introduce a new enumeration into TargetParser.h
+  // Arch extension modifiers for CPUs.
+  enum ArchExtKind {
+    INVALID_ARCHEXT = 0,
+    CRC,
+    CRYPTO,
+    FP,
+    HWDIV,
+    MP,
+    SEC,
+    VIRT,
+    LAST_ARCHEXT
+  };

sys/time.h on Solaris (and possibly other systems) defines "SEC" as "1" using a cpp macro.  The result is that this fails to compile.

A temporary workaround seems to be to #undef SEC in Solaris.h, but a better answer might be to prefix the enumeration values so there were no conflicts.
Comment 1 Reid Kleckner 2015-05-11 14:32:45 PDT
Generally our solution is to undef the macro. The enum is already namespaced inside ARM::, so adding a prefix would be pretty redundant.
Comment 2 Renato Golin 2015-05-11 14:53:13 PDT
I'm ok with adding the prefix, if that's preferred. I just kept the same names for consistency with the previous code.

Thinking about macros, conflicts with things like CRC and CRYPTO might be more common than we think...
Comment 3 Renato Golin 2015-05-12 05:35:03 PDT
Adding prefixes to the enums in r237112 / r237113.