Unix Technical Forum

Re: Remove warning about const qualifier

This is a discussion on Re: Remove warning about const qualifier within the Pgsql Patches forums, part of the PostgreSQL category; --> Kris Jurka <books@ejurka.com> writes: > The attached patch removes this warning: > encnames.c:511: warning: passing argument 1 of 'clean_encoding_name' ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql Patches

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-18-2008, 09:57 AM
Tom Lane
 
Posts: n/a
Default Re: Remove warning about const qualifier

Kris Jurka <books@ejurka.com> writes:
> The attached patch removes this warning:
> encnames.c:511: warning: passing argument 1 of 'clean_encoding_name'
> discards qualifiers from pointer target type


Applied, but I've not seen that warning myself ... what compiler are
you using exactly?

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 7: You can help support the PostgreSQL project by donating at

http://www.postgresql.org/about/donate

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-18-2008, 09:57 AM
Kris Jurka
 
Posts: n/a
Default Re: Remove warning about const qualifier



On Mon, 16 Apr 2007, Tom Lane wrote:

> Kris Jurka <books@ejurka.com> writes:
>> The attached patch removes this warning:
>> encnames.c:511: warning: passing argument 1 of 'clean_encoding_name'
>> discards qualifiers from pointer target type

>
> Applied, but I've not seen that warning myself ... what compiler are
> you using exactly?
>


I was testing a gcc 4.3 snapshot from 3/26/07. It also complains

hba.c:1199: warning: array subscript is below array bounds

Which looks pretty bogus to me. And then the following which may be
valid, but wasn't something I was concerned about at this time.

tuplesort.c: In function 'comparetup_heap':
tuplesort.c:2124: warning: inlining failed in call to 'myFunctionCall2':
--param large-stack-frame-growth limit reached
tuplesort.c:2175: warning: called from here
tuplesort.c:2124: warning: inlining failed in call to 'myFunctionCall2':
--param large-stack-frame-growth limit reached
tuplesort.c:2175: warning: called from here
tuplesort.c: In function 'ApplySortFunction':
tuplesort.c:2124: warning: inlining failed in call to 'myFunctionCall2':
--param large-stack-frame-growth limit reached
tuplesort.c:2175: warning: called from here
tuplesort.c: In function 'comparetup_datum':
tuplesort.c:2124: warning: inlining failed in call to 'myFunctionCall2':
--param large-stack-frame-growth limit reached
tuplesort.c:2175: warning: called from here
tuplesort.c: In function 'comparetup_index':
tuplesort.c:2124: warning: inlining failed in call to 'myFunctionCall2':
--param large-stack-frame-growth limit reached
tuplesort.c:2175: warning: called from here
tuplesort.c:2124: warning: inlining failed in call to 'myFunctionCall2':
--param large-stack-frame-growth limit reached
tuplesort.c:2175: warning: called from here

Kris Jurka


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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-18-2008, 09:57 AM
Tom Lane
 
Posts: n/a
Default Re: Remove warning about const qualifier

Kris Jurka <books@ejurka.com> writes:
> I was testing a gcc 4.3 snapshot from 3/26/07. It also complains
> hba.c:1199: warning: array subscript is below array bounds
> Which looks pretty bogus to me.


I agree.

> And then the following which may be
> valid, but wasn't something I was concerned about at this time.


> tuplesort.c: In function 'comparetup_heap':
> tuplesort.c:2124: warning: inlining failed in call to 'myFunctionCall2':
> --param large-stack-frame-growth limit reached
> tuplesort.c:2175: warning: called from here


We've got -Winline turned on mainly as a means of finding out whether
inlining happens or not. I think it's OK to ignore this unless it
happens all over the place.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 7: You can help support the PostgreSQL project by donating at

http://www.postgresql.org/about/donate

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-18-2008, 09:57 AM
Stefan Huehner
 
Posts: n/a
Default Re: Remove warning about const qualifier

On Mon, Apr 16, 2007 at 02:51:55PM -0400, Tom Lane wrote:
> Kris Jurka <books@ejurka.com> writes:
> > The attached patch removes this warning:
> > encnames.c:511: warning: passing argument 1 of 'clean_encoding_name'
> > discards qualifiers from pointer target type

>
> Applied, but I've not seen that warning myself ... what compiler are
> you using exactly?


In general these warning turn up with either -Wwrite-strings (which find
"string" embedded in the source code with are assigned to char*
variables (or given as parameters). Or using -Wcast-qual for 'general'
discarding a const qualifier.

Regards,
Stefan


---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 06:27 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com