strange indent problem. Please help!

strange indent problem. Please help!

Post by Charlie Xiaoli Hua » Sun, 29 Mar 1992 07:18:36



We recently encountered a problem with indent (/usr/bin/indent
on a sparc running 4.1.1). Given a file say foo.c, we run indent
on it to get bar.c. Then we run indent on bar.c to get fubar.c,
and one would expect that bar.c and fubar.c to be identical. Right?
Surprisingly they are not. The code follows:

-----------------------------------------------------------------------------
float           f_percent_0, f_percent_2, f_percent_4, f_percent_8, f_percent_20, r_percent_0,
                r_percent_2, r_percent_4, r_percent_8, r_percent_20, r_cons1_2,
                r_cons2_2, r_cons1_4, r_cons2_4, r_cons1_8, r_cons2_8,
                r_cons1_20, r_cons2_20, f_cons1_2, f_cons2_2, f_cons1_4,
                f_cons2_4, f_cons1_8, f_cons2_8, f_cons1_20, f_cons2_20;
-----------------------------------------------------------------------------

Notcie that on the first line the last var is r_percent_0. Running
indent with my .indent.pro being

-bap -bad -bbb -nbc -br -cdb -nce -ci4 -d0 -di16 -nfc1 -cli0 -i4 -ip2 -psl -sob

I got
-----------------------------------------------------------------------------
float           f_percent_0, f_percent_2, f_percent_4, f_percent_8, f_percent_20,
                r_percent_0, r_percent_2, r_percent_4, r_percent_8, r_percent_20,
                r_cons1_2, r_cons2_2, r_cons1_4, r_cons2_4, r_cons1_8,
                r_cons2_8, r_cons1_20, r_cons2_20, f_cons1_2, f_cons2_2,
                f_cons1_4, f_cons2_4, f_cons1_8, f_cons2_8, f_cons1_20,
                f_cons2_20;
-----------------------------------------------------------------------------

Notice that the var r_percent_0 has been moved to the second line.
Runnning indent again (no change in .indent.pro) I got
-----------------------------------------------------------------------------
float           f_percent_0, f_percent_2, f_percent_4, f_percent_8, f_percent_20, r_percent_0,
                r_percent_2, r_percent_4, r_percent_8, r_percent_20, r_cons1_2,
                r_cons2_2, r_cons1_4, r_cons2_4, r_cons1_8, r_cons2_8,
                r_cons1_20, r_cons2_20, f_cons1_2, f_cons2_2, f_cons1_4,
                f_cons2_4, f_cons1_8, f_cons2_8, f_cons1_20, f_cons2_20;
-----------------------------------------------------------------------------

Note that the var r_percent_0 bounced back to the 1st line again! This
process can be repeated man y many times. indent(1) BUGS section gives
no clue as to what might be wrong.

The weired thing is: gnu indent 1.2 had the identical problem. So I
start to wonder if this is a bug or a feature. And it is a feature,
what do I do to turn it off?

Thanks in advance,

 
 
 

1. indent in emacs --please help me--

I have tried almost everything to get emacs to make a normal tab when i
press tab. In text-mode it is ok but if i use html-helper-mode, c-mode
or anyting else, it just wont make that indent. If i press C-q <tab>, i
get what i want but, i want to be able to make my own tab-choices
regardless of what mode im in, so please help me....

[Bad-Knees]
when u absolutly dont know what to do next,
it is time to panic...

2. undefined symbol ....

3. Help please - strange FTP problem - any help much appreciated :)

4. DIP timing out?

5. strange... very strange. Please help!

6. High Level Question: how to delete file under solaris?? Filename is "-t"

7. PLEASE PLEASE HELP Major problem with my SCSI & Redhat 5.0 PLEASE Help

8. popen ()

9. Sendmail problems. Please please please please help!

10. LINUX instalation problems, PLEASE HELP !?!Subject: LINUX , instalation problems, PLEASE HELP !?!

11. Strange pppd problem, can a kernel guru please help !!!

12. Strange problems, please help.

13. Strange problem-Please Help