Thread: [PATCH] Buildfailure on OSX (10.3.9) + fix

[PATCH] Buildfailure on OSX (10.3.9) + fix

From
"Florian G. Pflug"
Date:
Hi

I've finally fixed my buildserver today, and discovered that
the build of pgadmin3 trunk on OSX 10.3.9 (gcc 3.3) fails
when compiling the debugger.

Attached is a patch that fixes the problem, though I must admit
that I soley found the fix through trial and error. I have
absolutly no idea why gcc complains about
wxString( wxString( PQsomething(result), wxConvUTF8 ))
but has no problem with
wxString( PQsomething(result), wxConvUTF8 )

The error message is:
wsDirectdbg.cpp: In member function `void
    wsDirectDbg::OnResultReady(wxCommandEvent&)':
wsDirectdbg.cpp:608: error: parse error before `,' token

Does someone have the slighest idea what gcc is unhappy about?
Anyway, patch is attached.

greetings, Florian Pflug
Index: debugger/wsDirectdbg.cpp
===================================================================
--- debugger/wsDirectdbg.cpp    (revision 6146)
+++ debugger/wsDirectdbg.cpp    (working copy)
@@ -605,7 +605,7 @@

     if(( PQresultStatus( result ) == PGRES_NONFATAL_ERROR ) || ( PQresultStatus( result ) == PGRES_FATAL_ERROR ))
     {
-        wxString    message( wxString(PQresultErrorMessage( result ), wxConvUTF8));
+        wxString message( PQresultErrorMessage( result ), wxConvUTF8 ) ;

         message.Replace( wxT( "\r" ), wxT( "" ));
         message.Replace( wxT( "\n" ), wxT( " " ));
@@ -615,7 +615,7 @@
     }
     else
     {
-        wxString message( wxString( PQcmdStatus( result ), wxConvUTF8 ));
+        wxString message( PQcmdStatus( result ), wxConvUTF8 );

         message.Replace( wxT( "\r" ), wxT( "" ));
         message.Replace( wxT( "\n" ), wxT( " " ));
@@ -667,7 +667,7 @@

     if(( PQresultStatus( rawResult ) == PGRES_NONFATAL_ERROR ) || ( PQresultStatus( rawResult ) == PGRES_FATAL_ERROR
))
     {
-        wxString    message( wxString( PQresultErrorMessage( rawResult ), wxConvUTF8 ));
+        wxString    message( PQresultErrorMessage( rawResult ), wxConvUTF8 );

         message.Replace( wxT( "\r" ), wxT( "" ));
         message.Replace( wxT( "\n" ), wxT( " " ));
@@ -677,7 +677,7 @@
     }
     else
     {
-        wxString message( wxString( PQcmdStatus( rawResult ), wxConvUTF8 ));
+        wxString message( PQcmdStatus( rawResult ), wxConvUTF8 );

         message.Replace( wxT( "\r" ), wxT( "" ));
         message.Replace( wxT( "\n" ), wxT( " " ));
Index: debugger/wsQueryWindow.cpp
===================================================================
--- debugger/wsQueryWindow.cpp    (revision 6146)
+++ debugger/wsQueryWindow.cpp    (working copy)
@@ -176,7 +176,7 @@

     if(( PQresultStatus( result ) == PGRES_NONFATAL_ERROR ) || ( PQresultStatus( result ) == PGRES_FATAL_ERROR ))
     {
-        wxString    message( wxString( PQresultErrorMessage( result ), wxConvUTF8 ));
+        wxString    message( PQresultErrorMessage( result ), wxConvUTF8 );

         message.Replace( wxT( "\r" ), wxT( "" ));
         message.Replace( wxT( "\n" ), wxT( " " ));

Re: [PATCH] Buildfailure on OSX (10.3.9) + fix

From
"Hiroshi Saito"
Date:
Hi Florian-san.

It was applied.
Is the screen of OSX comfortable?:-)
Thanks!

Regards,
Hiroshi Saito

----- Original Message -----
From: "Florian G. Pflug"


> Hi
>
> I've finally fixed my buildserver today, and discovered that
> the build of pgadmin3 trunk on OSX 10.3.9 (gcc 3.3) fails
> when compiling the debugger.
>
> Attached is a patch that fixes the problem, though I must admit
> that I soley found the fix through trial and error. I have
> absolutly no idea why gcc complains about
> wxString( wxString( PQsomething(result), wxConvUTF8 ))
> but has no problem with
> wxString( PQsomething(result), wxConvUTF8 )
>
> The error message is:
> wsDirectdbg.cpp: In member function `void
>    wsDirectDbg::OnResultReady(wxCommandEvent&)':
> wsDirectdbg.cpp:608: error: parse error before `,' token
>
> Does someone have the slighest idea what gcc is unhappy about?
> Anyway, patch is attached.
>
> greetings, Florian Pflug
>


--------------------------------------------------------------------------------


> Index: debugger/wsDirectdbg.cpp
> ===================================================================
> --- debugger/wsDirectdbg.cpp (revision 6146)
> +++ debugger/wsDirectdbg.cpp (working copy)
> @@ -605,7 +605,7 @@
>
>  if(( PQresultStatus( result ) == PGRES_NONFATAL_ERROR ) || ( PQresultStatus( result ) == PGRES_FATAL_ERROR ))
>  {
> - wxString message( wxString(PQresultErrorMessage( result ), wxConvUTF8));
> + wxString message( PQresultErrorMessage( result ), wxConvUTF8 ) ;
>
>  message.Replace( wxT( "\r" ), wxT( "" ));
>  message.Replace( wxT( "\n" ), wxT( " " ));
> @@ -615,7 +615,7 @@
>  }
>  else
>  {
> - wxString message( wxString( PQcmdStatus( result ), wxConvUTF8 ));
> + wxString message( PQcmdStatus( result ), wxConvUTF8 );
>
>  message.Replace( wxT( "\r" ), wxT( "" ));
>  message.Replace( wxT( "\n" ), wxT( " " ));
> @@ -667,7 +667,7 @@
>
>  if(( PQresultStatus( rawResult ) == PGRES_NONFATAL_ERROR ) || ( PQresultStatus( rawResult ) == PGRES_FATAL_ERROR ))
>  {
> - wxString message( wxString( PQresultErrorMessage( rawResult ), wxConvUTF8 ));
> + wxString message( PQresultErrorMessage( rawResult ), wxConvUTF8 );
>
>  message.Replace( wxT( "\r" ), wxT( "" ));
>  message.Replace( wxT( "\n" ), wxT( " " ));
> @@ -677,7 +677,7 @@
>  }
>  else
>  {
> - wxString message( wxString( PQcmdStatus( rawResult ), wxConvUTF8 ));
> + wxString message( PQcmdStatus( rawResult ), wxConvUTF8 );
>
>  message.Replace( wxT( "\r" ), wxT( "" ));
>  message.Replace( wxT( "\n" ), wxT( " " ));
> Index: debugger/wsQueryWindow.cpp
> ===================================================================
> --- debugger/wsQueryWindow.cpp (revision 6146)
> +++ debugger/wsQueryWindow.cpp (working copy)
> @@ -176,7 +176,7 @@
>
>  if(( PQresultStatus( result ) == PGRES_NONFATAL_ERROR ) || ( PQresultStatus( result ) == PGRES_FATAL_ERROR ))
>  {
> - wxString message( wxString( PQresultErrorMessage( result ), wxConvUTF8 ));
> + wxString message( PQresultErrorMessage( result ), wxConvUTF8 );
>
>  message.Replace( wxT( "\r" ), wxT( "" ));
>  message.Replace( wxT( "\n" ), wxT( " " ));
>


--------------------------------------------------------------------------------


>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings
>

Re: [PATCH] Buildfailure on OSX (10.3.9) + fix

From
"Florian G. Pflug"
Date:
Hiroshi Saito wrote:
> Hi Florian-san.
>
> It was applied. Is the screen of OSX comfortable?:-)
Yeah, it builds now. Thanks for applying!

I'd still like to understand why this patch is needed, though -
to me it seems like a blatant bug in the gcc c++ parser,
but I somehow doubt this.

Any ideas?

greetings, Florian Pflug