Compiler warnings with SunPro
Closed / Out of Date219231ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 23 years ago
Descriptionplain2000-10-26 05:03:54
OriginalBugID: 4291 Bug
Version: 8.3
SubmitDate: '2000-03-03'
LastModified: '2000-04-03'
Severity: LOW
Status: Assigned
Submitter: techsupp
ChangedBy: hobbs
RelatedBugIDs: 4203
OS: Solaris
OSVersion: 2.6
Machine: Sparc Ultra 60 450
FixedDate: '2000-10-25'
ClosedDate: '2000-10-25'
Name:
David Cuthbert
Extensions:
None
CustomShell:
None
ReproducibleScript:
Perform normal build under Sol 2.6, Workshop 4.2 or 5.0 (configure; make).
ObservedBehavior:
Compiler warnings. These do not affect the operation of Tcl, but are still undesirable.
"./../generic/regc_lex.c", line 380: warning: statement not reached
"./../generic/regc_lex.c", line 458: warning: statement not reached
"./../generic/regc_lex.c", line 464: warning: statement not reached
"./../generic/regc_lex.c", line 539: warning: statement not reached
"./../generic/regc_lex.c", line 569: warning: statement not reached
"./../generic/regc_lex.c", line 806: warning: statement not reached
"./../generic/regc_lex.c", line 971: warning: statement not reached
"./../generic/tclDate.c", line 1262: warning: statement not reached
"./../generic/tclDate.c", line 1475: warning: statement not reached
"./../generic/tclIOSock.c", line 97: warning: argument #5 is incompatible with prototype:
prototype: pointer to int : "/usr/include/sys/socket.h", line 338
argument : pointer to uint
"./../generic/tclIOSock.c", line 103: warning: argument #5 is incompatible with prototype:
prototype: pointer to int : "/usr/include/sys/socket.h", line 338
argument : pointer to uint
"./../generic/tclStubInit.c", line 44: warning: initializer does not fit or is out of range: 0xfca3bacf
"./../generic/tclStubInit.c", line 242: warning: initializer does not fit or is out of range: 0xfca3bacf
"./../generic/tclStubInit.c", line 316: warning: initializer does not fit or is out of range: 0xfca3bacf
"./../generic/tclStubInit.c", line 342: warning: initializer does not fit or is out of range: 0xfca3bacf
DesiredBehavior:
Clean compile
Patch:
*** regc_lex.c.origFri Mar 3 12:30:42 2000
--- regc_lex.c.newFri Mar 3 12:31:41 2000
***************
*** 377,383 ****
FAILW(REG_BADBR);
break;
}
- assert(NOTREACHED);
break;
case L_BRACK:/* brackets are not too hard */
switch (c) {
--- 377,382 ----
***************
*** 455,467 ****
RETV(PLAIN, c);
break;
}
- assert(NOTREACHED);
break;
default:
RETV(PLAIN, c);
break;
}
- assert(NOTREACHED);
break;
case L_CEL:/* collating elements are easy */
if (c == CHR('.') && NEXT1(']')) {
--- 454,464 ----
***************
*** 536,542 ****
INTOCON(L_EBND);
RET('{');
}
- assert(NOTREACHED);
break;
case CHR('('):/* parenthesis, or advanced extension */
if ((v->cflags®_ADVF) && NEXT1('?')) {
--- 533,538 ----
***************
*** 566,572 ****
FAILW(REG_BADRPT);
break;
}
- assert(NOTREACHED);
}
if (v->cflags®_NOSUB)
RETV('(', 0);/* all parens non-capturing */
--- 562,567 ----
***************
*** 803,809 ****
FAILW(REG_EESCAPE);/* unknown alphabetic escape */
break;
}
- assert(NOTREACHED);
}
/*
--- 798,803 ----
***************
*** 967,974 ****
RETV(PLAIN, c);
break;
}
-
- assert(NOTREACHED);
}
/*
--- 961,966 ----
*** tcl.h.origFri Mar 3 12:24:56 2000
--- tcl.h.newFri Mar 3 12:25:00 2000
***************
*** 1576,1582 ****
* value since the stubs tables don't match.
*/
! #define TCL_STUB_MAGIC 0xFCA3BACF
/*
* The following function is required to be defined in all stubs aware
--- 1576,1582 ----
* value since the stubs tables don't match.
*/
! #define TCL_STUB_MAGIC 0xFCA3BACFul
/*
* The following function is required to be defined in all stubs aware
*** tclCmdIL.c.origThu Feb 17 17:03:40 2000
--- tclCmdIL.c.newThu Feb 17 17:04:37 2000
***************
*** 1836,1842 ****
entryPtr = Tcl_NextHashEntry(&search);
}
}
! } else {
AppendLocals(interp, listPtr, simplePattern, 1);
}
--- 1836,1842 ----
entryPtr = Tcl_NextHashEntry(&search);
}
}
! } else if(((Interp *)interp)->varFramePtr->procPtr != 0) {
AppendLocals(interp, listPtr, simplePattern, 1);
}
*** tclDate.c.origFri Mar 3 12:04:25 2000
--- tclDate.c.newFri Mar 3 12:05:43 2000
***************
*** 1253,1271 ****
register int *TclDate_ps;/* top of state stack */
register int TclDate_state;/* current state */
register int TclDate_n;/* internal state number info */
- goto TclDatestack;/* moved from 6 lines above to here to please C++ */
-
/*
** get globals into registers.
- ** branch to here only if YYBACKUP was called.
- */
- TclDate_pv = TclDatepv;
- TclDate_ps = TclDateps;
- TclDate_state = TclDatestate;
- goto TclDate_newstate;
-
- /*
- ** get globals into registers.
** either we just started, or we just finished a reduction
*/
TclDatestack:
--- 1253,1260 ----
***************
*** 1467,1481 ****
{
case 0:/* new error */
TclDateerror( "syntax error" );
- goto skip_init;
- /*
- ** get globals into registers.
- ** we have a user generated syntax type error
- */
- TclDate_pv = TclDatepv;
- TclDate_ps = TclDateps;
- TclDate_state = TclDatestate;
- skip_init:
TclDatenerrs++;
/* FALLTHRU */
case 1:
--- 1456,1461 ----
*** tclIOSock.c.origFri Mar 3 12:32:54 2000
--- tclIOSock.c.newFri Mar 3 12:33:07 2000
***************
*** 94,106 ****
size_t len;
len = sizeof(int);
! getsockopt(sock, SOL_SOCKET, SO_SNDBUF, (char *)¤t, &len);
if (current < size) {
len = sizeof(int);
setsockopt(sock, SOL_SOCKET, SO_SNDBUF, (char *)&size, len);
}
len = sizeof(int);
! getsockopt(sock, SOL_SOCKET, SO_RCVBUF, (char *)¤t, &len);
if (current < size) {
len = sizeof(int);
setsockopt(sock, SOL_SOCKET, SO_RCVBUF, (char *)&size, len);
--- 94,106 ----
size_t len;
len = sizeof(int);
! getsockopt(sock, SOL_SOCKET, SO_SNDBUF, (char *)¤t, (int *)&len);
if (current < size) {
len = sizeof(int);
setsockopt(sock, SOL_SOCKET, SO_SNDBUF, (char *)&size, len);
}
len = sizeof(int);
! getsockopt(sock, SOL_SOCKET, SO_RCVBUF, (char *)¤t, (int *)&len);
if (current < size) {
len = sizeof(int);
setsockopt(sock, SOL_SOCKET, SO_RCVBUF, (char *)&size, len);
*** tclIntDecls.h.origFri Mar 3 12:24:13 2000
--- tclIntDecls.h.newFri Mar 3 12:24:26 2000
***************
*** 531,537 ****
GlobTypeData * types));
typedef struct TclIntStubs {
! int magic;
struct TclIntStubHooks *hooks;
int (*tclAccess) _ANSI_ARGS_((CONST char * path, int mode)); /* 0 */
--- 531,537 ----
GlobTypeData * types));
typedef struct TclIntStubs {
! unsigned long magic;
struct TclIntStubHooks *hooks;
int (*tclAccess) _ANSI_ARGS_((CONST char * path, int mode)); /* 0 */
PatchFiles:
regc_lex.c
tcl.h
tclCmdIL.c
tclDate.c
tclIOSock.c
tclIntDecls.h
We can remove the assert's, even though Henry probably put them
in there for some reason.
The "ul" on TCL_STUB_MAGIC won't work on non-ANSI compilers
(but: ((unsigned int) 0xFCA3BACF) should work). The CmdIL
fix was for itcl, and is already patched in.
The stuff in tclDate can't be changed that way because it is
auto-yacc'ed.
For tclIOSock, using the same compiler on 2.7, I don't get any
warnings.
The stubs magic can't be made unsigned long, because that would
change the size of the structure. Unsigned int might work (need
to see how it's used).
-- 04/03/2000 hobbs
dgp Ticket [219231ffff]: 1 change
[History diff]2001-04-05 06:52:45
lloydlimplain2001-08-04 02:04:01
Logged In: YES
user_id=99220
I get the same warnings for Tcl 8.3.3 on Solaris 7 (SunOS
5.7) with Sun Workshop compiler 5.0 (except for the
tclIOSock warnings).
Here are some cleaner patches to get rid of the warnings
(finally!):
--- tcl.h.old Thu Aug 2 21:57:37 2001
+++ tcl.h Thu Aug 2 17:25:05 2001
@@ -1647,7 +1647,7 @@
* value since the stubs tables don't match.
*/
-#define TCL_STUB_MAGIC 0xFCA3BACF
+#define TCL_STUB_MAGIC ((int) 0xFCA3BACF)
/*
* The following function is required to be defined in all
stubs aware
--- regc_lex.c.old Thu Aug 2 21:56:22 2001
+++ regc_lex.c Fri Aug 3 07:46:40 2001
@@ -30,6 +30,11 @@
*
*/
+/* Suppress "statement not reached" warnings from Sun
Workshop compiler. */
+#ifdef __SUNPRO_C
+# pragma error_messages(off, E_STATEMENT_NOT_REACHED)
+#endif
+
/* scanning macros (know about v) */
#define ATEOS() (v->now >= v->stop)
#define HAVE(n) (v->stop - v->now >= (n))
@@ -1059,3 +1064,7 @@
return (chr)lastresort;
return cv->chrs[0];
}
+
+#ifdef __SUNPRO_C
+# pragma error_messages(default, E_STATEMENT_NOT_REACHED)
+#endif
--- tclGetDate.y.old Thu Aug 2 22:00:17 2001
+++ tclGetDate.y Fri Aug 3 07:50:51 2001
@@ -33,6 +33,11 @@
#include "tclInt.h"
#include "tclPort.h"
+/* Suppress "statement not reached" warnings from Sun
Workshop compiler. */
+#ifdef __SUNPRO_C
+# pragma error_messages(off, E_STATEMENT_NOT_REACHED)
+#endif
+
#ifdef MAC_TCL
# define EPOCH 1904
# define START_OF_TIME 1904
You'll also need to do a "make gendate" to update tclDate.c.
(Note: I noticed that yacc 3.0 on Solaris produces a clean
tclDate.c that is identical to the one distributed.
However, the yaccs I tried on Linux and FreeBSD (no version
numbers available) produce files that are significantly
different and that don't necessarily compile. I'm not sure
if someone should worry about that or not.)
andreas_kupries Ticket [219231ffff]: 1 change
[History diff]2001-09-08 06:35:45
hobbsplain2003-07-19 03:40:16
Logged In: YES user_id=72656 all can be ignored.
Log in (anonymous is fine) to add a comment.