Re: duplicate typedefs and system headers ?

From: Luigi Rizzo <rizzo_at_iet.unipi.it>
Date: Wed, 28 Jan 2009 13:17:34 +0100
On Wed, Jan 28, 2009 at 12:47:44PM +0100, Christoph Mallon wrote:
...
> >Would this be better/more compliant with standards -- i.e.,
> >is the following code correct ? gcc seems to have no objections.
> >
> >	struct foo;
> >	int a(struct foo *);
> >	typedef struct foo bar;
> >	int a(bar *x) { ... }
> 
> What is the problem with just including the correct header? This would 
> be The Right Thing(tm). Everything else is just an ugly hack.

In this context I only need to know that a typedef (or struct)
with that name exists, not its internals.

The "correct header" defines the actual structure and has tons of other
dependencies which make the code harder to read, maintain and compile.

Again, if I had a chance to fix the underlying header(s) I would do,
but at least right now I don't have such a possibility.

	cheers
	luigi
Received on Wed Jan 28 2009 - 11:12:02 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:41 UTC