[comp.std.c] Query about typedef type-checking

iiit-sh@cybaswan.UUCP (Steve Hosgood) (09/09/88)

Sorry to have to post this, it's a fairly trivial question I know, but I
don't have a copy of the proposed ANSI spec.

Put simply, does the upcoming standard intend to enforce (or warn about)
mixing 'typedef'-ed types even if the fundamental items 'beneath' the typedefs
are the same?

Specifically, if you have the following:

void fred(long *);

typedef long funny_t;

main()
{
	funny_t a;

	fred(&a);
	....
}

..will the compilers barf, or produce a warning or what?
Obviously, the code itself is perfectly runnable, and portable, as long as
the typedef of 'funny' continues to be a 'long'.

I'd like to see a warning here - am I alone?
Am I going to be dissapointed?
Thanks in advance.

Please E-mail, I'll summarise.

-----------------------------------------------+------------------------------
Steve Hosgood BSc,                             | Phone (+44) 792 295213
Image Processing and Systems Engineer,         | Fax (+44) 792 295532
Institute for Industrial Information Techology,| Telex 48149
Innovation Centre, University of Wales, +------+ JANET: iiit-sh@uk.ac.swan.pyr
Swansea SA2 8PP                         | UUCP: ..!ukc!cybaswan.UUCP!iiit-sh
----------------------------------------+-------------------------------------
            My views are not necessarily those of my employers!

scjones@sdrc.UUCP (Larry Jones) (09/16/88)

In article <74@cybaswan.UUCP>, iiit-sh@cybaswan.UUCP (Steve Hosgood) writes:
> Put simply, does the upcoming standard intend to enforce (or warn about)
> mixing 'typedef'-ed types even if the fundamental items 'beneath' the typedefs
> are the same?

No, the draft maintains the K&R interpretation that typedef does not create a
new type, merely a different way to specify an existing type.  Warnings are
not considered to be in the scope of a standard - if you'd like one, bother
your compiler vendor enough to convince them to add it.

----
Larry Jones                         UUCP: uunet!sdrc!scjones
SDRC                                      scjones@sdrc.uucp
2000 Eastman Dr.                    BIX:  ltl
Milford, OH  45150                  AT&T: (513) 576-2070
"Save the Quayles" - Mark Russell