sid@ucbvax.berkeley.edu (S. Cowles) (02/14/91)
When running indent(1) under SunOS 4.0.3 on files under sccs control, I've been plagued by certain behaviors from indent. The sccs keyword %Z% is used by what(1) to print out strings embedded in files; usually this keyword is translated to the string: @(#). When invoking indent on c code files that have this string present in a macro definition not protected by quotes, indent forces the sharp to begin the next line, like a compiler directive, and breaks the macro. The only workaround I've been able to come up with so far is to use indent only on the editable version of sccs files which do not yet have the %Z% substituted. Example code before indent: #define SCCSID(arg) static char sccsid[]="arg" SCCSID(@(#) file.c 1/2/3); Example code after indent: #define SCCSID(arg) static char sccsid[]="arg" SCCSID(@( #) file.c 1/2/3); In a related problem, when running indent on editable versions of sccs files, indent breaks the sccs keywords. Example code before indent: #define SCCSID(arg) static char sccsid[]="arg" SCCSID(%W% %U% %E%); Example code after indent: #define SCCSID(arg) static char sccsid[]="arg" SCCSID(%W % %U % %E %); Are these behaviors features or bugs? If they are bugs, are there any patches available? sid cowles internet: uucp: sid@sybase.com {pacbell,sun,{uunet,ucbvax}!mtxinu}!sybase!sid scowles@humpty.llnl.gov {backbone}!lll-winken!humpty!scowles scowles@ccc.nersc.gov