Article View: comp.std.c
Article #4910Re: Bit-field sizes
From: Norman Diamond
Date: Tue, 19 Mar 1996 02:58
Date: Tue, 19 Mar 1996 02:58
26 lines
2036 bytes
2036 bytes
In article <827022001snz@genesis.demon.co.uk>, Lawrence Kirby <fred@genesis.demon.co.uk> writes:
>In article <4hpkcv$gjc@info1.sdrc.com> larry.jones@sdrc.com "Larry Jones" writes:
>>Sure they can -- once you've declared a bit-field with a non-conforming
>>type you've invoked undefined behavior and the compiler is at liberty to
>>do anything it likes from then on.
>Lets say (with reference to 6.5.2.1) I declare:
> struct bit { long field : CHAR_BIT*sizeof(long) + 1; };
>This results in undefined behaviour due to the long type of the declarator.
>However a constraint is also violated due to the field width. Is a diagnostic
>still required in this case or can the compiler omit it as a form of undefined
>behaviour?
If I understand correctly, a technical corrigendum requires that a
diagnostic be issued for a translation unit which violates any syntax
rule or constraint, even if violations of other clauses occur "earlier"
in the translation unit.
From one point of view, I am glad to see that requirement. From a
different point of view, I fear that even highest quality implementations
are now forced to issue a blanket warning at the beginning of translation.
--
<< If this were the company's opinion, I would not be allowed to post it. >>
"I paid money for this car, I pay taxes for vehicle registration and a driver's
license, so I can drive in any lane I want, and no innocent victim gets to call
the cops just 'cause the lane's not goin' the same direction as me" - J Spammer
Technical Details
Message-ID:
<4il7sp$dgp@usenet.pa.dec.com>Path:
arc1-ca.pugleaf.net!tbj.dec.com!diamondReferences:
<nzRPxQ9ytZZA084yn@csn.net> <4hkgds$bbh@info1.sdrc.com> <4ho846$g2d@usenet.pa.dec.com> <4hpkcv$gjc@info1.sdrc.com> <827022001snz@genesis.demon.co.uk>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!tbj.dec.com!diamond From: diamond@tbj.dec.com (Norman Diamond) Newsgroups: comp.std.c Subject: Re: Bit-field sizes Date: 19 Mar 1996 02:58:33 GMT Organization: Digital Equipment Corporation Japan , Tokyo Message-ID: <4il7sp$dgp@usenet.pa.dec.com> References: <nzRPxQ9ytZZA084yn@csn.net> <4hkgds$bbh@info1.sdrc.com> <4ho846$g2d@usenet.pa.dec.com> <4hpkcv$gjc@info1.sdrc.com> <827022001snz@genesis.demon.co.uk> Reply-To: diamond@tbj.dec.com (Norman Diamond) NNTP-Posting-Host: jit533.tbj.dec.com