| Title: | DECC |
| Notice: | General DEC C discussions |
| Moderator: | TLE::D_SMITH N TE |
| Created: | Fri Nov 13 1992 |
| Last Modified: | Fri Jun 06 1997 |
| Last Successful Update: | Fri Jun 06 1997 |
| Number of topics: | 2212 |
| Total number of notes: | 11045 |
I have some code from a customer that compiles just fine
with the -oldc flag, but fails when running with out the
flag.
Is this valid C code? I've never seen the construct:
((EIF_BOOLEAN (*) (EIF_INTEGER)) func)(0L)
Can someone explain this to me if it is valid? The compiler
pucks on this if it is not used in conjunction with the conditional
expression.
Look at the ANSI C Standard, still none the wiser.
Version Info:
$ uname -a
OSF1 uxtlaser.alf.dec.com V4.0 564 alpha
$ cc -V
DEC C V5.2-036 on Digital UNIX V4.0 (Rev. 564)
<SNIP>
--------------------------(The Error) 8< ---------------------------
cc -O0 -D__LANGUAGE_C__ -D_NO_PROTO -c cl1394_d.c
GEM ASSERTION, Compiler internal error - please submit problem report
Fatal error in: /usr/lib/cmplrs/cc/gemc_cc Terminated
-------------------------- (The Code) 8< ---------------------------
/*
Filename cl1394_d.c
Compile Instructions:
Fails: cc -O0 -D__LANGUAGE_C__ -D_NO_PROTO -c cl1394_d.c
Works: cc -oldc -O0 -D__LANGUAGE_C__ -D_NO_PROTO -c cl1394_d.c
*/
typedef long EIF_INTEGER;
typedef unsigned char EIF_BOOLEAN;
EIF_BOOLEAN func()
{
return 1L;
}
void Eiz86k4 ()
{
EIF_BOOLEAN a;
a=(EIF_BOOLEAN)((((EIF_BOOLEAN (*) (EIF_INTEGER)) func)(0L)) ? 1 : 0);
}
-------------------------- 8< ---------------------------
Michael Maxie - C05751 DTN 343-0120
OSAPPL Group - CSC Support
| T.R | Title | User | Personal Name | Date | Lines |
|---|---|---|---|---|---|
| 2212.1 | Problem in DEC C V5.2, appears fixed in V5.6 and later... | DECC::SULLIVAN | Jeff Sullivan | Thu Jun 05 1997 17:37 | 16 |
This appears to be aa problem with DEC C V5.2 compilers on Digital UNIX. That includes V4.0 - V4.0C. We have submitted compilers to the support pool for patches, but it appears to be a problem there as well. The workaround (as you probably determined) is to not compile with -O0. You could compile with -g3, if you need debug symbols in the optimized program. The good news is that it appears to be fixed in the V5.6 compiler that will be available on Digital UNIX V4.0D. A field test version of that compiler is available at http://www.zk3.dec.com/decc/decc-kitinfo.html How important is it to get a fix for the V5.2 compiler, given the above info? Thanks for reporting the problem. -Jeff | |||||