GNU Indent 2.2.9 unary minus erroneous whitespace removal

Simon <[email protected]>
Newsgroups gmane.comp.gnu.indent.bugs
Message-ID <[email protected]>
GNU Indent 2.2.9 erroneously removes / fails to reinsert whitespace 
between a pair of unary minus operators; thus changing double negation 
"- -x" into a self decrement "--x"; for example changing the legal code 
below into illegal code:

$ cat example.c
 
int main(void)
{
  return - -0;
}
 
$ indent --verbose example.c
There were 5 non-blank output lines and 0 comments
$ cat example.c
 
int
main (void)
{
  return --0;
}


or worst still, performing silent until runtime corruption of a variable.

rgds
Simon.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.