PATCH: don't warn about types defined in casts for sys headers
Nathan Sidwell
nathan@codesourcery.com
Thu Nov 9 01:35:00 GMT 2000
Brendan Kehoe wrote:
> a system package from a random vendor, they chose to implement something by
> way of a type defined inside a cast. Since those headers were not available
> for quick fixing, it seemed instead to carry forward into this check the
> idea
> that we shouldn't bitch about what systems (not users) have chosen to do.
I disagree. I'm getting fed up with working around broken system headers.
The Right Thing is to warn with -fpermissive. The only way system headers are
going to get fixed is if users file bug reports with system vendors - and they
ain't going to do that if they never get a diagnostic.
For instance, the following won't compile on some systems without #defining OK,
#ifdef OK
#include <sys/time.h>
#include <sys/time_impl.h>
#endif
#include <pthread.h>
void foo ()
{
struct timespec timeout;
pthread_cond_timedwait (0, 0, &timeout);
}
because struct timespec is declared in a parameter list and its definition
is in sys/time_impl.h which is only included when KERNEL is true - ugh!
nathan
--
Dr Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
'But that's a lie.' - 'Yes it is. What's your point?'
nathan@codesourcery.com : http://www.cs.bris.ac.uk/~nathan/ : nathan@acm.org
More information about the Gcc-bugs
mailing list