[cfe-dev] clang++ and g++ difference. Who is right ?

Jean-Daniel Dupas devlists at shadowlab.org
Wed Jul 7 00:47:25 PDT 2010


Hello,

I know there is come C++ expert around, so maybe someone may tell me who is right and who is wrong compiling the following code:



---------------- extern.cpp ---------------
#include <stdio.h>

namespace lldb_private { const char *GetVersion(); }

const char * lldb_private::GetVersion() {
  extern const double LLDBVersionNumber;
  static char g_version_string[32];
  if (g_version_string[0] == '\0')
    ::snprintf (g_version_string, sizeof(g_version_string), "LLDB-%g", LLDBVersionNumber);
    
		return g_version_string;
}
-------------------------------------------


-- Jean-Daniel




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20100707/8f91e461/attachment.html>


More information about the cfe-dev mailing list