[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference turris::decc

Title:DECC
Notice:General DEC C discussions
Moderator:TLE::D_SMITHNTE
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

2200.0. "Confusing / missing syntax-error msg" by GALVIA::STONES (Tom Stones) Fri May 23 1997 13:32

Compiling the following : 

	typedef int A;

	typedef int A, *AP;

	void f (AP ap);

Gives:
  >cc junk.c
  cc: Error: junk.c, line 7: In this declaration, no typedef with the 
  name "AP"  occurs in any accessible scope.
  void f (AP ap);
  --------^
  >



This error msg is quite confusing when there is a lot of code between the two
typedefs!

Tom.
T.RTitleUserPersonal
Name
DateLines
2200.1Which Compiler? acc, or decc?XDELTA::HOFFMANSteve, OpenVMS EngineeringFri May 23 1997 15:222
   Which UNIX release? -- if this isn't at least 4.0, use cc -migrate.
2200.2Bug postedDECC::VOGELTue May 27 1997 10:3919
    
    Tom,
    
    This seems to be a bug in DEC C.  I have posted this in our
    internal bugs notes file as CXXC_BUGS 4386.
    
    It seems that when a typedef declares several identifiers, and
    there is a problem with one of the identifiers, the compiler ignores
    subsequent identifiers.  In your case the identifier A is already
    declared (in -std mode we'll emit a warning of this).
    
    As I expect you realize, the workaround is to remove one of the
    declarations of the typedef A.
    
    Thanks for finding this for us, sorry for the difficulty it caused.
    
    					Ed
    
    
2200.3FixedDECC::VOGELTue May 27 1997 16:3812
    
    Tom,
    
    This was a problem in the compiler.  We have fixed the problem
    in our internal sources.  The fix should be included in the compiler
    that ships with Digital UNIX V4.0d.
    
    Again, thanks for finding this for us.
    
    					Ed