clang++ and g++ difference. Who is right ?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

clang++ and g++ difference. Who is right ?

Jean-Daniel Dupas-2
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





_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: clang++ and g++ difference. Who is right ?

Eli Friedman
On Wed, Jul 7, 2010 at 12:47 AM, Jean-Daniel Dupas
<[hidden email]> wrote:
> 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:

Umm, what's the issue?  It appears to compile with both g++ and
clang++ without errors.

-Eli
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev