delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/03/24/07:34:56

Xref: news2.mv.net comp.os.msdos.djgpp:2097
From: jgt2 AT Lehigh DOT EDU (JESSE THILO)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: typedefs
Date: 19 Mar 1996 14:39:20 -0500
Lines: 14
Message-ID: <4in2h8$1isf@ns3-1.CC.Lehigh.EDU>
References: <4i1ctq$neh AT nntp DOT crl DOT com>
NNTP-Posting-Host: ns3-1.cc.lehigh.edu
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

: I noticed that the following line of code
:   typedef asdf long;
: causes a compiler error in gcc.  I checked the documentation and sure
: enough, "typedef" means something completely different in gcc than in
: standard C compilers.  Is there a way to let typedef do the standard
: thing?

What are you talking about?  In my universe, you can't redefine a
built-in type.  "typedef long asdf" is the way it's done (in gcc and
in standard C).  Think of it like a variable declaration, where the
variable is the name of a new type:

int foo[10];		/* foo is an array of 10 integers */
typedef int foo[10];	/* type foo is an array of 10 integers */

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019