This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, fixincludes] Fix NULL on AIX


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]