[PATCH, fixincludes] Fix NULL on AIX

Bruce Korb bkorb@gnu.org
Tue Apr 30 16:52:00 GMT 2013


Hi David,

Looks good to me, but for a small nit:

On Tue, Apr 30, 2013 at 7:40 AM, David Edelsohn <dje.gcc@gmail.com> wrote:
> +    c_fix_arg = "#ifndef NULL\n"
> +               "#ifdef __cplusplus\n"
> +               "#ifdef __GNUG__\n"
> +               "#define NULL\t__null\n"
> +               "#else\t /* ! __GNUG__  */\n"
> +               "#define NULL\t0L\n"
> +               "#endif\t /* __GNUG__  */\n"
> +               "#else\t /* ! __cplusplus  */\n"
> +               "#define NULL\t((void *)0)\n"
> +               "#endif\t /* __cplusplus  */\n"
> +               "#endif\t /* !NULL  */";

I'd really prefer a "here string":

c-fix-arg = <<- _EOF_
        #ifndef NULL
        #ifdef __cplusplus
        #ifdef __GNUG__
        #define NULL    __null
        #else   /* ! __GNUG__  */
        #define NULL    0L
        #endif  /* __GNUG__  */
        #else   /* ! __cplusplus  */
        #define NULL    ((void *)0)
        #endif  /* __cplusplus  */
        #endif  /* !NULL  */
        _EOF_;

Unless there is some reason you want to emphasize tabs with the "\t" escapes.
I think the "here string" is easier to read.



More information about the Gcc-patches mailing list