#1122 gcc compiler complains about tclDecls.h

obsolete: 8.2.2
closed-fixed
nobody
2
2001-04-04
2000-10-26
Anonymous
No

OriginalBugID: 4121 Bug
Version: 8.2.2
SubmitDate: '2000-02-03'
LastModified: '2000-02-05'
Severity: MED
Status: Released
Submitter: techsupp
ChangedBy: hobbs
OS: SunOS
OSVersion: SunOS cotton 5.5.1 Generic_103640-31
Machine: sun4u sparc SUNW,Ultra-30
FixedDate: '2000-02-05'
FixedInVersion: 8.3
ClosedDate: '2000-10-25'

Name:
jeff deifik

Comments:
We are also using tcl with lynx, which is a much older version.
I cannot build the new version of tcl, because I fear the lynx (os)
folks have not sent in the config file diffs...

ReproducibleScript:
file x.c:
#include <stdio.h>
#include <unistd.h>
#include <tcl.h>
main() {}

compile with gcc 2.95.2 19991024 as follows:
gcc -Wall -Wshadow x.c -o x.o

ObservedBehavior:
/usr/local/include/tclDecls.h:544: warning: declaration of `write' shadows
global declaration
/usr/local/include/tclDecls.h:1418: warning: declaration of `write' shadows
global declaration

DesiredBehavior:
I don't expect you folks to use variables named 'write' which conflict with a
well known unix system function name.

The user first had FoundIn at 8.0.4, but that's not possible with
tclDecls.h, so they realized it was actually 8.2.2. The warning
received is no error. It come from the declaration of Tcl_GetOpenFile
using 'int write' as a variable. This doesn't even occur on our
Solaris 2.7/gcc build with -Wshadow. However, I've changed the decl
to use 'int forWriting' instead.

On the other note, we don't have anything in our tcl.m4 for LynxOS.
-- 02/05/2000 hobbs

Discussion

  • Brent B. Welch
    Brent B. Welch
    2000-10-26

    • priority: 5 --> 2
    • status: open --> closed-fixed
     
  • Don Porter
    Don Porter
    2001-04-04

    • labels: 104235 --> 53. Configuration and Build Tools