Even though your suggestions were good, they weren't applicable to this
particular issue.  In fact, running the find command to find all the
source files with indented directives only showed up a couple lines as
follows (using a slightly different command than you supplied):

 % find . -name '*.[ch]' | xargs egrep '^[: :]+#'
 ./sieve/addr-lex.c: #pragma warn -rch
 ./sieve/addr-lex.c: #pragma warn -use
 ./sieve/sieve-lex.c: #pragma warn -rch
 ./sieve/sieve-lex.c: #pragma warn -use

Even though it has no bearing on the problem I was having, it is worth
fixing those few lines (by removing the single space before the #pragma)
just to increase the portability of the source code.

Scott

--On Wednesday, July 23, 2003 7:24 AM +0200 Nikola Milutinovic <[EMAIL PROTECTED]> wrote:

"First thing first", to quote your message. Have you cleaned up the
source from indented CPP directives?

GCC (and possibly other C compilers) support indentation of CPP
directives (#define, #include, etc.). CC doesn't deal with this and
ignores such lines. There is no public standard that allows it - the most
that is allowed is to indent the directive, but to keep "#" in column 1.
So, this is what GNU allows:

# ifdef HAS_GETADDRINF
    #define OK
    #include <sys/socket.h>
# else
    #include <sys/sock5.h>
# endif

DEC CC would go no further than this:

# ifdef HAS_GETADDRINF
#    define OK
#    include <sys/socket.h>
# else
#    include <sys/sock5.h>
# endif

So, the first thing to do is clean up all "*.c", "*.h" and "configure*"
files that you can find. I use a script:

find . \( -name "configure*" -o -name "*.c" -o -name "*.h" \) -exec grep
-E "^( |\t)( |\t)*#(i|d|e|p|u)" {} \; -print

(I have placed "\t" for TABs, in my script they are really TABs - cant
display TABs in MS Outlook Express).

Then look at what's reported and edit all those files. Or write another
script to do the change - "sed" comes to mind. Or Perl.

When you have cleaned up, then you can start tracking errors and bugs.

Nix.



-- +-----------------------------------------------------------------------+ Scott W. Adkins http://www.cns.ohiou.edu/~sadkins/ UNIX Systems Engineer mailto:[EMAIL PROTECTED] ICQ 7626282 Work (740)593-9478 Fax (740)593-1944 +-----------------------------------------------------------------------+ PGP Public Key available at http://www.cns.ohiou.edu/~sadkins/pgp/

Attachment: pgp00000.pgp
Description: PGP signature



Reply via email to