This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Two suggestions for gcc C compiler to extend C language (by WD Smith)
- From: Warren D Smith <warren dot wds at gmail dot com>
- To: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- Cc: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Fri, 29 Jul 2016 15:01:45 -0400
- Subject: Re: Two suggestions for gcc C compiler to extend C language (by WD Smith)
- Authentication-results: sourceware.org; auth=none
- References: <CAAJP7Y3cHYEOpdhZUXF1PZAJ=vkKoozRiPgwm2V_jH_T63XTKw@mail.gmail.com> <CAH6eHdRrmRWARhbcqWbqV07Y=SZp+Hsiv5-42y2k28CHqP4+UQ@mail.gmail.com> <CAAJP7Y0oRZmE4qS=shs4m7EWjWK2RfZdK2NSe1Kx1ZUT6W=QZw@mail.gmail.com> <57979B3B.3010405@westcontrol.com> <CAAJP7Y1SpgdXPubqZkJCTqUrg2uHTfRz2oVyCf0vDdnyTKAKCw@mail.gmail.com> <CAAJP7Y2-JcjiKXZ3xdpXnjPnAMj64SZQSY8s8euj4VZOo9SzLg@mail.gmail.com> <5797ABB0.9090702@westcontrol.com> <CAAJP7Y3uG3paTsnGFrUdpygQ7h7W_JR4pkbkYdfvnaJGbHbzgw@mail.gmail.com> <57986C9D.8060602@westcontrol.com> <CAAJP7Y0NavO8uBHnR5718oCEmkO6ph4bY9DrR5hZB+9UnB21LA@mail.gmail.com> <579B2491.2090008@westcontrol.com> <CAAJP7Y0+VHkBqTTx8E_tSbyr94xY9B_RD_wOskSwCORC_VprCA@mail.gmail.com> <CAH6eHdQd=gB8oR95Vd0wT9YxSiUGMeqrvmtsL34bLu+43vk0oA@mail.gmail.com> <CAAJP7Y38VbjgX2VRg38PGGpMhdy=2+96=j1uUQRnGZW=zW8KPQ@mail.gmail.com>
> Given a pointer to an array of nibbles and a length, how do I iterate
> through the array?
for(i=0; i<bitsizeof(a); i++){ s += a[i]; }
--correction, that was for an array of packed bools. For nybbles,
bitsizeof(a)/4. There are various games one can play, and quibbles one
can make, all of which should have been so blitheringly obvious it
should not have ever been necessary to have this discussion at all.
Similarly, when some twerp complained
x=mul(a,b)
would be unacceptable because "mul" was too likely to be a name
already used by somebody... seriously? You're really unable to figure
out how to deal with that
without me telling you?
It just boggles my mind that this stuff comes back at me for hours and hours.
--
Warren D. Smith
http://RangeVoting.org <-- add your endorsement (by clicking
"endorse" as 1st step)