From mboxrd@z Thu Jan 1 00:00:00 1970 From: Albert ARIBAUD Date: Tue, 12 Jul 2011 17:29:29 +0200 Subject: [U-Boot] [RESEND PATCH v2 1/5] Tegra2: Add macros to calculate bitfield shifts and masks In-Reply-To: References: <1309884558-7700-1-git-send-email-sjg@chromium.org> <1309884558-7700-2-git-send-email-sjg@chromium.org> <4E185DFC.9010605@aribaud.net> <20110711061633.7A28E1579E14@gemini.denx.de> Message-ID: <4E1C6859.2060500@aribaud.net> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Anton, Le 11/07/2011 18:19, Anton Staaf a ?crit : > I know that this is throwing more fuel on the fire (for which I am sorry), > but I don't follow the argument that this is unportable. As far as I can > tell, the # : # syntax is not using any special compiler extensions, it is > simply substituted into a (boo) ? # : # expression, thus extracting either > the first of second number from the definition of the bit field. > > If I am wrong I would be interested to know what about this is not standard > pre-processor usage? For me at least (Wolfgang might have other reasons), the issue is not the use of the pre-processor per se, it is that this "syntax" breaks the '?:' "triadic" operator in pieces, one piece in argument value and one in macro body, and neither piece makes sense from a C standpoint: '5:3' represents no meaningful C entity, and 'X ? y' (without the ':' and third argument of the operator) is not a proper C construct. IOW, it is syntactic sugaring done at the expense of code readability. > Thanks, > Anton Amicalement, -- Albert.