GNU bug report logs -
#39409
CC Mode 5.33.1 (C/*l); Wrong fontification of "foo * sizeof"
Previous Next
Full log
View this message in rfc822 format
Hi,
Thank you for all your work on CC Mode. And yeah, I know C syntax can
get pretty hairy. :)
The curious thing is, though, this issue doesn't seem to occur with
"foo * bar(baz)". What I'm seeing seems to happen specifically when
the "function" is actually a keyword (like sizeof), and the expression
is enclosed in parentheses:
void foo()
{
xxx(xxx * xxx(xxx)); /* correct */
xxx(ttt * sizeof(xxx)); /* wrong */
xxx(xxx, xxx * xxx(xxx)); /* correct */
xxx(xxx, ttt * sizeof(xxx)); /* wrong */
ttt * fff(xxx); /* ambiguous, but logical */
xxx * sizeof(xxx); /* correct */
(xxx * xxx(xxx)); /* correct */
(ttt * sizeof(xxx)); /* wrong */
xxx = xxx * xxx(xxx); /* correct */
xxx = xxx * sizeof(xxx); /* correct */
xxx = (ttt * fff(xxx)); /* wrong (I think) */
xxx = (xxx * sizeof(xxx)); /* correct */
}
(In these examples, 'xxx' uses the default face, 'ttt' uses
font-lock-type-face, 'fff' uses font-lock-function-name-face, and of
course 'sizeof' uses font-lock-keyword-face.)
I tried the standalone version (cc-mode-5.34.tar.gz) and it appears to
give the same results as above.
Benjamin
This bug report was last modified 5 years and 161 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.