Re: [PATCH 2/15 v2] Unhardcode byte size being 8 bits.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Alexey,

"This is a GCC extension. sizeof(void) is invalid C and should error out
and does with -pedantic-errors"

Yuk, who ever thought to use -pedantic-errors!

-ansi or -std=c89 or -std=c99 don't elicit any diagnostics.

I don't really see why you take this as a tragedy. People seem
to like this extension:

I appreciate the reason for wanting to make this extension to
be friendly to people wanting to migrate pre-C standard code
and start using void.

There is plenty of opportunity for all sorts of subtle bugs here
and I would have hoped that gcc was more proactive in warning
users.  If people writing new code want a pointer to behave like
a char * then why not declare the fact.

Of course sparse has to support this usage, but I would expect it
to flag any usage as an error.

--
Derek M. Jones                         tel: +44 (0) 1252 520 667
Knowledge Software Ltd                 mailto:derek@xxxxxxxxxxxx
Source code analysis                   http://www.knosof.co.uk
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux