Re: Expected behavior for -cs and -ncs

John E Hein <[email protected]>
Newsgroups gmane.comp.gnu.indent.bugs
Message-ID <[email protected]>
david ingamells wrote at 19:42 +0200 on Jul 23, 2008:
 > This works in 2.2.10:
 > 
 > $ indent -npro -ncs
 > 
 > unsigned char *cp = (unsigned char *)ptr;
 > int
 > foo ()
 > {
 >   return (int)n;
 > }
 > 
 > $ indent -npro -cs
 > 
 > unsigned char *cp = (unsigned char *) ptr;
 > int
 > foo ()
 > {
 >   return (int) n;
 > }
 > 
 > 
 > I know of no update that fixed this in 2.2.10, so I am surprised that it 
 > doesn't work in 2.2.9.
 > I have added this to the regression test now, so it will be checked in 
 > the future.

Seems okay in my local test here on 2.2.9, too...


echo '(unsigned char *)ptr;' | gindent -npro -cs
(unsigned char *) ptr;

echo '(unsigned char *)ptr;' | gindent -npro -ncs
(unsigned char *)ptr;

However, --no-space-after-cast fails:


echo '(unsigned char *)ptr;' | gindent -npro --space-after-cast
(unsigned char *) ptr;

echo '(unsigned char *)ptr;' | gindent -npro --no-space-after-cast
indent: unknown option "no-space-after-cast"
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.