Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: carlson@decc.enet.dec.com (Tom Carlson)
Subject: Re: [Q]: DECladebug - can't find sufficient debug info
Date: 1995/04/05	[thread overview]
Message-ID: <3lv524$i8m@jac.zko.dec.com> (raw)
In-Reply-To: 3ljq08$g5q@ibch10.inf.tu-dresden.de


In article <3ljq08$g5q@ibch10.inf.tu-dresden.de>, winkler@ibc.inf.tu-dresden.de (Matthias Winkler) writes:

|>After having failed to convince cc of the correctness of an
|>ANSI-C statement I switched to gcc.  With this compiler I
|>do not seem to get the kind of debugging information cc is
|>used to producing.

Matthias,

Your test case reduces to the following:

  typedef struct {
      unsigned int  (*towupper) ();
      unsigned int  (*towlower) ();
  } _LC_core_ctype_t;

  struct _LC_ctype_t {
    _LC_core_ctype_t core;
  } *__lc_ctype;

  main()
  {
     char c;

    (*(__lc_ctype->core.towupper))(c, __lc_ctype);

  }

cc -warnprotos foo.c
/usr/lib/cmplrs/cc/cfe: Warning: foo.c, line 14: No prototype for this call
   (*(__lc_ctype->core.towupper))(c, __lc_ctype);
 --------------------------------^

From the man page on -warnprotos : 
"Cause the compiler to produce warning messages when a
 function is is called that is not declared with a full prototype.
 This checking is more strict than required by ANSI C.
"
cc is perfectly correct in warning you... there _is no_ prototype
for the pointer to function referenced in line 14.  This is just an additional
check cc made that gcc did not happen to pick up on. If you don't want this 
additional error checking, you can always not use -warnprotos . 

>  Besides compiling pretty
> closed to ANSI C gcc will give me a lot of useful warnings (about
> '/*' within comments, about unused variables and functions and
> so on).  That's why I switched to gcc.

As we discussed offline, you can alternately invoke the DEC C compiler
with checks enabled by compiling "cc -migrate -check" (or use lint)
in addition to or instead of the error checking of gcc.
Both cc and DEC C ("cc -migrate") compiler are fully ANSI compliant,
I assure you.

To be clear... the problem in your test case was in a common header 
file, used by both cc and gcc.  Therefore gcc can't 'fix' this 
problem for you.. it just failed to diagnose it. Unfortunately, 
the headers on the system are not quite all ANSI compliant yet.
You seemed happy with the debugging info generated by cc and DEC C

Regards,

Tom

--

Thomas Carlson,   DEC C/ DEC C++     carlson@decc.enet.dec.com
Digital Equipment Corporation,  ZK2-3/N30           
110 Spitbrook Rd,
Nashua, NH  03062



  parent reply	other threads:[~1995-04-05  4:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1995-04-01  5:00 [Q]: DECladebug - can't find sufficient debug info Matthias Winkler
1995-04-03  4:00 ` Peter Mayne
1995-04-03  4:00 ` Jeff Diewald
1995-04-03  4:00 ` Tom Carlson
1995-04-05  4:00 ` Tom Carlson [this message]
1995-04-06  4:00 ` Jeff Diewald
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox