Coding convention: use of `!x' vs. `! x'

David Edelsohn dje@watson.ibm.com
Fri Sep 22 09:50:00 GMT 2000


>>>>> Richard Kenner writes:

> However, I suggest that within GCC we use a consistent style going
> forward, and that the style be `!x' rather than `! x'.  This is no big
> deal, and it would be a waste of effort to change all uses of the
> latter into the former, but going forward let's use the former style.

Richard> What about the other unary operators?  Should they have a blank, like the
Richard> binary operators do, or no blank, like "!" now will?

	There may not be any definition in the GNU Coding Standards, but I
always have seen spaces around unary operators and that has been the
standard (I guess informal) that I was told.  I am not commenting on
whether I like it or not, but I disagree with making this style change.
If we now have `!x' and `~x' scattered throughout the code, I think it is
because we have not been as diligent about maintaining the original style
as we used to be.  To maintain symmetry with the rest of the style, I
think that unary operators should have spaces, contrary to Mark's
proposal.

David


More information about the Gcc mailing list