[Python-bugs-list] [ python-Bugs-232787 ] 2.1a1 compiler warnings under Solaris 8 with gcc

nobody nobody@sourceforge.net
Tue, 06 Mar 2001 04:19:01 -0800


Bugs #232787, was updated on 2001-02-16 17:25
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=232787&group_id=5470

Category: Build
Group: Platform-specific
Status: Closed
Priority: 5
Submitted By: Mark Favas
Assigned to: Martin v. Löwis
Summary: 2.1a1 compiler warnings under Solaris 8 with gcc

Initial Comment:
Platform: SunOS asafoetida 5.8 Generic_108528-04 sun4u sparc SUNW,Ultra-60
(actually a 220R server)
Compiler: gcc version 2.95.2 19991024 (release)
2.1a2: CVS version of Feb 16

The following compiler warnings are reported:

gcc -c -g -O2 -Wall -Wstrict-prototypes -I. -I./Include -DHAVE_CONFIG_H  
-o Objects/floatobject.o Objects/floatobject.c
Objects/floatobject.c:35: warning: function declaration isn't a prototype

gcc -c -g -O2 -Wall -Wstrict-prototypes -I. -I./Include -DHAVE_CONFIG_H  
-o Objects/intobject.o Objects/intobject.c
Objects/intobject.c: In function `PyInt_FromString':
Objects/intobject.c:185: warning: subscript has type `char'

gcc -c -g -O2 -Wall -Wstrict-prototypes -I. -I./Include -DHAVE_CONFIG_H  
-o Python/errors.o Python/errors.c
Python/errors.c: In function `PyErr_Format':
Python/errors.c:405: warning: subscript has type `char'
Python/errors.c:460: warning: subscript has type `char'
Python/errors.c:465: warning: subscript has type `char'
Python/errors.c:468: warning: subscript has type `char'

gcc -c -g -O2 -Wall -Wstrict-prototypes -I. -I./Include -DHAVE_CONFIG_H  
-o Python/pythonrun.o Python/pythonrun.c
Python/pythonrun.c: In function `initsigs':
Python/pythonrun.c:1192: warning: function declaration isn't a prototype

gcc -g -O2 -Wall -Wstrict-prototypes -I. -I./Include -DHAVE_CONFIG_H   
-c ./Modules/posixmodule.c -o Modules/posixmodule.o
./Modules/posixmodule.c: In function `posix_confstr':
./Modules/posixmodule.c:4524: warning: implicit declaration of function `confstr'

gcc -g -O2 -Wall -Wstrict-prototypes -I. -I./Include -DHAVE_CONFIG_H   
-c ./Modules/signalmodule.c -o Modules/signalmodule.o
./Modules/signalmodule.c:88: warning: function declaration isn't a prototype
./Modules/signalmodule.c: In function `signal_signal':
./Modules/signalmodule.c:212: warning: function declaration isn't a prototype
./Modules/signalmodule.c:214: warning: function declaration isn't a prototype
./Modules/signalmodule.c:225: warning: function declaration isn't a prototype
./Modules/signalmodule.c: In function `initsignal':
./Modules/signalmodule.c:332: warning: function declaration isn't a prototype
./Modules/signalmodule.c:336: warning: function declaration isn't a prototype
./Modules/signalmodule.c:355: warning: function declaration isn't a prototype
./Modules/signalmodule.c:357: warning: function declaration isn't a prototype
./Modules/signalmodule.c: In function `finisignal':
./Modules/signalmodule.c:556: warning: function declaration isn't a prototype
./Modules/signalmodule.c:564: warning: function declaration isn't a prototype

<gcc compile lines omitted from here down>

Modules/stropmodule.c: In function `strop_atoi':
/export/home0/mark/src/python/CVS/python/dist/src/Modules/stropmodule.c:752: warning: subscript has type `char'

Modules/timemodule.c: In function `time_strptime':
/export/home0/mark/src/python/CVS/python/dist/src/Modules/timemodule.c:398: warning: subscript has type `char'

Modules/socketmodule.c: In function `PySocket_socket':
/export/home0/mark/src/python/CVS/python/dist/src/Modules/socketmodule.c:1854: warning: function declaration isn't a prototype
/export/home0/mark/src/python/CVS/python/dist/src/Modules/socketmodule.c: In function `PySocket_fromfd':
/export/home0/mark/src/python/CVS/python/dist/src/Modules/socketmodule.c:1892: warning: function declaration isn't a prototype

In file included from /usr/include/curses.h:23,
from /usr/local/lib/gcc-lib/sparc-sun-solaris2.8/2.95.2/include/curses.h:5,
from Include/py_curses.h:8,
from Modules/_cursesmodule.c:104:
/usr/include/widec.h:38: warning: `getwc' redefined
/usr/include/iso/wchar_iso.h:337: warning: this is the location of the previous 
definition
/usr/include/widec.h:39: warning: `putwc' redefined
/usr/include/iso/wchar_iso.h:340: warning: this is the location of the previous 
definition
/usr/include/widec.h:40: warning: `getwchar' redefined
/usr/include/iso/wchar_iso.h:338: warning: this is the location of the previous 
definition
/usr/include/widec.h:41: warning: `putwchar' redefined
/usr/include/iso/wchar_iso.h:341: warning: this is the location of the previous 
definition
Modules/_cursesmodule.c: In function `PyCurses_Putp':
Modules/_cursesmodule.c:2135: 
warning: implicit declaration of function `putp'
Modules/_cursesmodule.c: In function `PyCurses_tigetflag':
Modules/_cursesmodule.c:2219: 
warning: implicit declaration of function `tigetflag'
Modules/_cursesmodule.c: In function `PyCurses_tigetnum':
Modules/_cursesmodule.c:2232: 
warning: implicit declaration of function `tigetnum'
Modules/_cursesmodule.c: In function `PyCurses_tigetstr':
Modules/_cursesmodule.c:2245: 
warning: implicit declaration of function `tigetstr'
Modules/_cursesmodule.c:2245: 
warning: assignment makes pointer from integer without a cast
Modules/_cursesmodule.c: In function `PyCurses_tparm':
Modules/_cursesmodule.c:2270: 
warning: implicit declaration of function `tparm'
Modules/_cursesmodule.c:2270: 
warning: assignment makes pointer from integer without a cast
Modules/_cursesmodule.c:2273: 
warning: assignment makes pointer from integer without a cast
Modules/_cursesmodule.c:2276: 
warning: assignment makes pointer from integer without a cast
Modules/_cursesmodule.c:2279: 
warning: assignment makes pointer from integer without a cast
Modules/_cursesmodule.c:2282: 
warning: assignment makes pointer from integer without a cast
Modules/_cursesmodule.c:2285: 
warning: assignment makes pointer from integer without a cast
Modules/_cursesmodule.c:2288: 
warning: assignment makes pointer from integer without a cast
Modules/_cursesmodule.c:2291: 
warning: assignment makes pointer from integer without a cast
Modules/_cursesmodule.c:2294: 
warning: assignment makes pointer from integer without a cast
Modules/_cursesmodule.c:2297: 
warning: assignment makes pointer from integer without a cast

In file included from /usr/include/curses.h:23,
from /usr/local/lib/gcc-lib/sparc-sun-solaris2.8/2.95.2/include/curses.h:5,
from Include/py_curses.h:8,
from Modules/_curses_panel.c:15:
/usr/include/widec.h:38: warning: `getwc' redefined
/usr/include/iso/wchar_iso.h:337: warning: this is the location of the previous 
definition
/usr/include/widec.h:39: warning: `putwc' redefined
/usr/include/iso/wchar_iso.h:340: warning: this is the location of the previous 
definition
/usr/include/widec.h:40: warning: `getwchar' redefined
/usr/include/iso/wchar_iso.h:338: warning: this is the location of the previous 
definition
/usr/include/widec.h:41: warning: `putwchar' redefined
/usr/include/iso/wchar_iso.h:341: warning: this is the location of the previous 
definition
Modules/_curses_panel.c: In function `PyCursesPanel_set_panel_userptr':
Modules/_curses_panel.c:307: warning: passing arg 2 of `set_panel_userptr' from incompatible pointer type

Modules/fpectlmodule.c: In function `fpe_reset':
Modules/fpectlmodule.c:144: warning: implicit declaration of function `nonstandard_arithmetic'
Modules/fpectlmodule.c:145: warning: implicit declaration of function `ieee_flags'
Modules/fpectlmodule.c:146: warning: implicit declaration of function `ieee_handler'




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

Comment By: Martin v. Löwis
Date: 2001-03-06 04:19

Message:
Logged In: YES 
user_id=21627

Fixed most of these problems, in the following file
revisions: acconfig.h 1.45, config.h.in 2.89, configure.in
1.210, timemodule.c 2.108, intobject.c 2.56, errors.c 2.62,
floatobject 2.80

The SIG_* problems remain and are document in signalmodule.c
2.58. 
For fpectl, sunmath.h needs to be included, but it is
difficult to find its location (unless compilation uses
SunPRO). No attempt was made to deal with the curses
warnings, since different warnings are produced when ncurses
is installed.

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

Comment By: Martin v. Löwis
Date: 2001-03-05 22:51

Message:
Logged In: YES 
user_id=21627

I'll analyse this further.

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

Comment By: Skip Montanaro
Date: 2001-02-27 09:05

Message:
Logged In: YES 
user_id=44345

I took a look at these warnings.  Here's my summary.  Sorry
I can't be more helpful.  Is there someone else out there
with gcc on a Solaris system that can dig into these
warnings?

* floatobject.c - The code here should probably have a
tighter restriction - the comment suggests that it is only
for SUNOS 4.1, but the ifdef just says "#ifdef sun".  I've
no idea what the various version-related options are.

* various type `char' warnings - All these messages seem to
suggest a GCC wart in the isalnum macro.  I use 2.95.3 on my
Linux system but don't get these warnings.

* pythonrun.c - sure looks like a prototype to me.

* posixmodule.c - confstr is declared in <unistd.h> on my
system.  Looks like it's not included in this Solaris build
environment.  I will add the proper #ifdef and #include for
unistd.h to this file.

* signalmodule.c & socketmodule.c - GCC is complaining about
use of the fake signal handlers SIG_DFL, SIG_ERR and
SIG_IGN.  Again, I get no warnings on my Linux system using
GCC 2.95.3. 

* _cursesmodule.c & _curses_panel.c - There is a comment in
_cursesmodule.c about why <term.h> isn't included, then goes
on to declare a couple terminfo functions.  Those that are
implicitly declared here seem to be declared in curses.h and
ncurses.h, one of which is included in _cursesmodule.c I
think it's probably best to pass these off to ESR or someone
else with recent experience digging around in that module.

fpectlmodule.c - This is in a Sun-specific section of code. 
I don't see any of these symbols declared on my Linux
system.  The code suggests that the author expected them to
be declared in math.h.  They probably are declared when
using Sun's compiler, but not gcc.  I don't know what their
canonical definitions are, otherwise I'd insert some
declarations (their return types are all cast away to void). 

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

Comment By: Tim Peters
Date: 2001-02-23 11:28

Message:
Skip, you have time to look at this?  Most of them have to do with Unix-specific functions (i.e., I can't test them on my box, so don't want to change their source code).

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

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=232787&group_id=5470