Re: Tcl 8.5 HP/UX Compiler warnings

From: R. T. Wurth (rwurth_at_att.net)
Date: 01/13/04


Date: Tue, 13 Jan 2004 02:59:44 GMT


(Sorry if the earlier post leaked out. My newsreader scrambled the
post, deleting lots of what I'd written and adding in old junk.
I canceled it. Here's what I meant to say.)

In article <1005fi5et9blga1@corp.supernews.com>, claird@phaseit.net
wrote:
> In article <btjm92$g6k$2@srv38.cas.org>, <lvirden@yahoo.com> wrote:
> .
> >I'd normally say "no", but there are several platforms whose
compilers
> >are ... 'unique' in their behavior and error reporting. What
> >specific compiler and version are you using on HP/UX ?
> .
> As bad as the reputation of HP's compilers is, I
> believe Tcl is up to a clean generation with all
> of them. I think I can help fix up any real pro-
> blems found.
>
> Larry's right, of course: specific details'll
> move this along much faster.

I thought I had provided as much as possible by quoting uname
results and "the optional HP ANSI C compiler", esp. since it doesn't
support anything like a --version option. Then I tried something
different, using what(1):

rwurthHPAnsiCView:urkel@ uname -a
HP-UX urkel B.11.00 U 9000/800 1552710528 unlimited-user license
rwurthHPAnsiCView:urkel@ ls -l /usr/bin/cc
lr-xr-xr-t 1 root sys 17 Mar 5 2003 /usr/bin/cc ->

/opt/ansic/bin/cc
rwurthHPAnsiCView:urkel@ ls -l /opt/ansic/bin/cc
-r-xr-xr-x 2 bin bin 606208 Jun 13 2002
/opt/ansic/bin/cc
rwurthHPAnsiCView:urkel@ what /opt/ansic/bin/cc
/opt/ansic/bin/cc:
         LINT B.11.11.06 CXREF B.11.11.06
         HP92453-01 B.11.11.06 HP C Compiler
          $ Sep 8 2000 23:13:51 $

Also, I traced two of the classes of error messages far enough to
open bug reports 874058 and 873919.

Far more details are in the bug reports, but the executive summaries
are:

1.) After all the substitutions, stat64 struct pointers are being
supplied to the stat and lstat system calls that should take regular
stat struct pointers. The elementary types of the structure
elements match, but there is one instance where the declared types
differ (but they both eventually resolve through typedefs to the
same elementary type), and there's another place where both declared
type and name differ, but the eventual base type (after resolving
all the typedefs) is the same.

2.) Tcl, trying to be portable makes a TclFd (storage for a file
pointer/descriptor) the biggest thing it could think of, a pointer.
The UNIX implementation of File I/O knows that it's native file
descriptor is only an int. The macros that cast back and forth
cause a warning when the 64-bit pointer is converted to a 32-bit int
and arithmetic is performed. In reality, since UNIX fd's are
limited in range to very small integers, there is no real problem
beyond this compiler warning that scares the living daylights out of
naive users like me.

I think I've come up with similarly reasonable arguments that the
other warnings I cited are similarly harmless. Still, I'd think the
fewer compiler warnings, the better off, so that new bugs don't get
hidden amidst all the clutter of warnings.

--
 Rich Wurth / rwurth@att.net / Rumson, NJ  07760 USA
 Consultant to the telecom industry


Relevant Pages

  • Re: Tcl 8.5 HP/UX Compiler warnings
    ... I have checked the core sources and tcl either uses 'struct ... That the compiler is complaining about feeding the ... that's because file descriptors really are pointers on some ... > other warnings I cited are similarly harmless. ...
    (comp.lang.tcl)
  • Help - buried in compiler warnings.
    ... I have an app which compiles with no errors or warnings ... But a user reports that with gcc 4.0.2 there are pages ... whose prototype calls for pointers to signed char arrays. ... The compiler options used are -g -O -Wall ...
    (comp.os.linux.development.apps)
  • Re: Function to do nothing
    ... > warnings to tell me that some parameter passed is not being used. ... eg pointers i can do: ... > if(pIn); ... It depends on your compiler, of course, but as a general notion it would ...
    (comp.lang.cpp)
  • Re: new IL: C (sort of...).
    ... only for "recent" Pascals, ... far pointers weren't really limited, ... in my compiler, I made wchar_t a builtin type (in most cases, aliased to ... I could very well include builtin "managed strings" in the new IL. ...
    (comp.lang.misc)
  • Re: new IL: C (sort of...).
    ... and the frontend compiler needs to be able ... Having very limited pointers is a fact of life in a VM language though, ... vague claims about Pascal's pointer support. ... That is pretty normal for standards (the ...
    (comp.lang.misc)