Tk Source Code

View Ticket
Login
Ticket UUID: 449161
Title: using gcc on Solaris produces warnings
Type: Bug Version: obsolete: 8.3.3
Submitter: lloydlim Created on: 2001-08-08 15:15:20
Subsystem: 84. Unix Build Assigned To: mdejong
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2001-08-27 01:25:48
Resolution: Wont Fix Closed By: lloydlim
    Closed on: 2001-08-26 18:25:48
Description:
On SunOS 5.7 (Solaris 7), using configure --enable-gcc
to use gcc (I'm using gcc 2.95.2) produces tons of
warning as follows:

In file included from
/n/bmrca/users/lim/src/original/tk8.3.3/unix/../generic/tk.h:83,
                 from
/n/bmrca/users/lim/src/original/tk8.3.3/unix/../generic/tkInt.h:21,
                 from
/n/bmrca/users/lim/src/original/tk8.3.3/unix/../generic/tk3d.h:18,
                 from
/n/bmrca/users/lim/src/original/tk8.3.3/unix/../generic/tk3d.c:16:
/usr/openwin/include/X11/Xlib.h:32: warning: ignoring
pragma: "@(#)Xlib.h       1.7     00/09/27 SMI

It would be nice if compiling Tk didn't spew out tons
of these warnings.  Here is a patch to eliminate them
(only on Solaris):

--- aclocal.m4.old      Wed Aug  8 07:39:09 2001
+++ aclocal.m4  Wed Aug  8 07:51:59 2001
@@ -985,6 +985,9 @@
            DL_LIBS="-ldl"
            if test "$using_gcc" = "yes" ; then
               
LD_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}'
+
+                # Solaris headers contain pragmas
+               CFLAGS_WARNING="${CFLAGS_WARNING}
-Wno-unknown-pragmas"
            else
                LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}'
            fi
User Comments: lloydlim added on 2001-08-27 01:25:48:
Logged In: YES 
user_id=99220

Both Mo and Jeff don't like this patch, so I'm closing this item.

There's no other way to fix this problem.

Since gcc is just complaining about pragmas it doesn't know about, I see no harm in shutting it up.  I can 
understand why others disagree though.

lloydlim added on 2001-08-24 11:32:09:
Logged In: YES 
user_id=99220

gcc 2.95.2 isn't that old.  And, yes, I know the warning is
harmless, that's
why I recommended not checking for it.  And, no, I didn't
say it was Tk's
fault...

I suppose we just work differently.  Where I work, warnings
are not
tolerated because they could be potential problems.  We
eliminate all the
harmless warnings so they don't obscure more important ones
that might
happen to show up.  IMHO, it's much cleaner.  No more paging
through
screens of warnings that you've seen a million times
before.  But it's up to
you, if you want to leave it that way.

dkf added on 2001-08-21 19:01:11:
Logged In: YES 
user_id=79902

This is a local compiler problem, but those warnings do not
matter (they're only giving a file identity for a file that
is not part of Tk.)  Presumably a different version of GCC
will no longer moan about it; I've had all sorts of problems
in the past when GCC has not been properly matched to the OS
version I've been using, but none of these can be reasonably
said to be Tk's fault...