Patch for const char* error

4 messages Options
Embed this post
Permalink
Helio Chissini de Castro

Patch for const char* error

Reply Threaded More More options
Print post
Permalink
Hi

gcc >= 4.4. now issues formal errors for some invalid conversions.
For now this patch is only one cpp, but fdo has some large amount of usage of
char* where should be const char*. Would be a good idea fix this "warning",
even good for perfomance reason.

[]'s

--
Helio Chissini de Castro
KDE Developer
Brasil/South America Primary Contact

[fdo-trunk-prefix.cpp-const.patch]

Index: /lixo/ecos/fdo/Fdo/Unmanaged/Src/Fdo/ClientServices/prefix.cpp
===================================================================
--- /lixo/ecos/fdo/Fdo/Unmanaged/Src/Fdo/ClientServices/prefix.cpp (revisão 4726)
+++ /lixo/ecos/fdo/Fdo/Unmanaged/Src/Fdo/ClientServices/prefix.cpp (cópia de trabalho)
@@ -380,7 +380,8 @@
 char *
 br_extract_dir (const char *path)
 {
- char *end, *result;
+ const char *end;
+ char *result;
 
  br_return_val_if_fail (path != NULL, NULL);
 
@@ -414,7 +415,8 @@
 char *
 br_extract_prefix (const char *path)
 {
- char *end, *tmp, *result;
+ const char *end;
+ char *tmp, *result;
 
  br_return_val_if_fail (path != NULL, NULL);
 


_______________________________________________
fdo-internals mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-internals
Greg Boone

RE: Patch for const char* error

Reply Threaded More More options
Print post
Permalink
Looks OK.

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Helio Chissini de Castro
Sent: Tuesday, June 02, 2009 10:09 AM
To: [hidden email]
Subject: [fdo-internals] Patch for const char* error

Hi

gcc >= 4.4. now issues formal errors for some invalid conversions.
For now this patch is only one cpp, but fdo has some large amount of usage of
char* where should be const char*. Would be a good idea fix this "warning",
even good for perfomance reason.

[]'s

--
Helio Chissini de Castro
KDE Developer
Brasil/South America Primary Contact

_______________________________________________
fdo-internals mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-internals
Traian Stanev

RE: Patch for const char* error

Reply Threaded More More options
Print post
Permalink
In reply to this post by Helio Chissini de Castro
Hi Helio,


Yes, I agree, I have also noticed the large number of warnings due to non-const correct calls in the Nls message functions. I remember that you submitted a patch for this a while back for 3.4, but it was not checked in since it would introduce a binary incompatibility between minor versions. I think it should be ok to fix them now that we are on 3.5, but let's make sure Greg is ok with that.

Traian


-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Helio Chissini de Castro
Sent: Tuesday, June 02, 2009 10:09 AM
To: [hidden email]
Subject: [fdo-internals] Patch for const char* error

Hi

gcc >= 4.4. now issues formal errors for some invalid conversions.
For now this patch is only one cpp, but fdo has some large amount of usage of
char* where should be const char*. Would be a good idea fix this "warning", even good for perfomance reason.

[]'s

--
Helio Chissini de Castro
KDE Developer
Brasil/South America Primary Contact

_______________________________________________
fdo-internals mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-internals
Greg Boone

RE: Patch for const char* error

Reply Threaded More More options
Print post
Permalink
3.5 already contains the formal FDO API char* -> const char* changes. I have no issue with making the changes Helio suggests. Sounds like a good idea.

Greg

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Traian Stanev
Sent: Tuesday, June 02, 2009 10:17 AM
To: [hidden email]
Subject: RE: [fdo-internals] Patch for const char* error

Hi Helio,


Yes, I agree, I have also noticed the large number of warnings due to non-const correct calls in the Nls message functions. I remember that you submitted a patch for this a while back for 3.4, but it was not checked in since it would introduce a binary incompatibility between minor versions. I think it should be ok to fix them now that we are on 3.5, but let's make sure Greg is ok with that.

Traian


-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Helio Chissini de Castro
Sent: Tuesday, June 02, 2009 10:09 AM
To: [hidden email]
Subject: [fdo-internals] Patch for const char* error

Hi

gcc >= 4.4. now issues formal errors for some invalid conversions.
For now this patch is only one cpp, but fdo has some large amount of usage of
char* where should be const char*. Would be a good idea fix this "warning", even good for perfomance reason.

[]'s

--
Helio Chissini de Castro
KDE Developer
Brasil/South America Primary Contact

_______________________________________________
fdo-internals mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-internals