OCamlPro / gnucobol

A clone of the sourceforge GnuCOBOL compiler from COBOL to C.
https://get-superbol.com
GNU Lesser General Public License v3.0
16 stars 20 forks source link

Fix warnings in GC4 #148

Closed ddeclerck closed 2 months ago

ddeclerck commented 2 months ago

@GitMensch Here are my changes to fix the warnings on the GC4 branch. If that's okay I'll commit that to SVN (with an appropriate ChangeLog entry).

GitMensch commented 2 months ago

For the two new files that looks good. For call.c - why don't we have that issue in 3.x?

ddeclerck commented 2 months ago

For the two new files that looks good. For call.c - why don't we have that issue in 3.x?

Actually the problem also occurs in GC3, if you explicitly disable NLS (configure --disable-nls). In GC4 the strings where these error occurs are not localized. Makes sense, the truncation analysis can not deduce the size of strings returned by gettext.

Maybe you just want to turn this analysis off ?

GitMensch commented 2 months ago

OK, if that warning is visible also in 3.x, then commit the changes to the other two files upstream and we can consider this PR finished.

ddeclerck commented 2 months ago

OK, if that warning is visible also in 3.x, then commit the changes to the other two files upstream

Not sure what you want me to do with the third one (libcob/call.c) ; should I commit it as well ?

GitMensch commented 2 months ago

no, let's inspect that later and have a separate fix (so we can easily merge it)

ddeclerck commented 2 months ago

Alright.

Interestingly, the unsigned qualifiers were added in a previous commit to solve warnings: https://sourceforge.net/p/gnucobol/code/4993/ My PR actually undoes these changes to resolve other warnings. Pretty weird.

GitMensch commented 2 months ago

oops..

GitMensch commented 2 months ago

The fields that are passed to isspace() and friends need to stay unsigned.

ddeclerck commented 2 months ago

The fields that are passed to isspace() and friends need to stay unsigned.

Indeed, I overlooked this. I'll just add appropriate casts when needed (as suggested by man).

GitMensch commented 2 months ago

if that works fine for you - happy commit :-)