From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,35c21d39e99f9b63 X-Google-Attributes: gidfee84,public From: carlson@decc.enet.dec.com (Tom Carlson) Subject: Re: [Q]: DECladebug - can't find sufficient debug info Date: 1995/04/05 Message-ID: <3lv524$i8m@jac.zko.dec.com>#1/1 X-Deja-AN: 100926849 distribution: world sender: carlson@kikkin.zko.dec.com (Tom Carlson) references: <3ljq08$g5q@ibch10.inf.tu-dresden.de> organization: Digital Equipment Corporation keywords: DECladebug, gcc, debugging information, debugging options reply-to: carlson@decc.enet.dec.com (Tom Carlson) newsgroups: comp.unix.osf.osf1 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