[cfe-dev] netbsd & gcc 4.6 triple

James K. Lowden jklowden at schemamania.org
Mon Apr 23 20:00:22 PDT 2012

On Mon, 23 Apr 2012 22:30:24 -0400
"James K. Lowden" <jklowden at schemamania.org> wrote:

> I am building Clang 3.0.99 with gcc 4.6.  The message below suggests
> Triple.cpp is confused.  The enumerated type "NetBSD" should be
> defined in the enum in Triple.h on line 93.  The message says that
> its value is 199905, which appears to come from the preprocessor.
> That string is used in places like config.guess.  

The preprocessed code confirms the problem:

const char *Triple::getOSTypeName(OSType Kind) {
  switch (Kind) {
  case UnknownOS: return "unknown";

  case AuroraUX: return "auroraux";
  case Cygwin: return "cygwin";
  case Darwin: return "darwin";
  case DragonFly: return "dragonfly";
  case FreeBSD: return "freebsd";
  case IOS: return "ios";
  case KFreeBSD: return "kfreebsd";
  case Linux: return "linux";
  case Lv2: return "lv2";
  case MacOSX: return "macosx";
  case MinGW32: return "mingw32";
  case 199905: return "netbsd";
  case OpenBSD: return "openbsd";
  case Solaris: return "solaris";
  case Win32: return "win32";
  case Haiku: return "haiku";
  case Minix: return "minix";
  case RTEMS: return "rtems";
  case NativeClient: return "nacl";
  case CNK: return "cnk";


One other point of information: the value 199905 is fixed in the NetBSD
headers, which include a cautionary note to use "__NetBSD_Version__"
instead of "NetBSD".  


> It would be nice if "199905" appeared in a header somewhere, but no.
> Any suggestions for how to track it down?  
> Error message follows.  Thanks.  
> --jkl
> llvm[1]: Compiling Triple.cpp for Release build
> Triple.cpp: In static member function 'static const char*
> llvm::Triple::getOSTypeName(llvm::Triple::OSType)': 
> Triple.cpp:99:10: warning: enumeration value 'NetBSD' not 
> 	handled in switch [-Wswitch] 
> Triple.cpp:113:3: warning: case value '199905' not in 
> 	enumerated type 'llvm::Triple::OSType' [-Wswitch] 
> Triple.cpp: In function 'llvm::Triple::OSType 
> 	parseOS (llvm::StringRef)': 
> Triple.cpp:282:35: error: expected unqualified-id before 
> 	numeric constant 
> Triple.cpp:292:1: warning: control reaches end of 
> 	non-void function [-Wreturn-type]
> rm: /usr/pkgsrc/wip/clang/work/llvm/lib/Support/Release/Triple.d.tmp:
> 	No such file or directory 
> gmake[1]: ***
> [/usr/pkgsrc/wip/clang/work/llvm/lib/Support/Release/Triple.o] Error 1
> gmake[1]: Leaving directory
> `/usr/pkgsrc/wip/clang/work/llvm/lib/Support' gmake: *** [all] Error 1
> *** Error code 2
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev

More information about the cfe-dev mailing list