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]

[committed] fixincludes: less va_list rewriting


We can avoid rewriting va_list, if the file included <stdarg.h> or if there is some other form of protection.

Tested on darwin.

2004-10-28 Mike Stump <mrs@apple.com>

        * inclhack.def (stdio_va_list): Don't fix if stdarg.h is
          included or ifdef va_start.

Doing diffs in fixincludes:
*** fixincludes/inclhack.def.~1~        Thu Oct 28 13:40:02 2004
--- fixincludes/inclhack.def    Thu Oct 28 19:34:19 2004
*************** fix = {
*** 2692,2706 ****


/*
! * Don't use or define the name va_list in stdio.h.
! * This is for ANSI and also to interoperate properly with gcc's
! * varargs.h. Note _BSD_VA_LIST_ is dealt with elsewhere. The
! * presence of __gnuc_va_list, __DJ_va_list, or _G_va_list is taken
! * to indicate that the header knows what it's doing -- under SUSv2,
! * stdio.h is required to define va_list, and we shouldn't break that.
! * On IRIX 6.5, internal/wchar_core.h used to get its definition of
! * va_list from stdio.h. Since this doesn't happen any longer, use
! * __gnuc_va_list there, too.
*/
fix = {
hackname = stdio_va_list;
--- 2692,2705 ----



/* ! * Don't use or define the name va_list in stdio.h. This is for ! * ANSI. Note _BSD_VA_LIST_ is dealt with elsewhere. The presence ! * of __gnuc_va_list, __DJ_va_list, or _G_va_list is taken to ! * indicate that the header knows what it's doing -- under SUSv2, ! * stdio.h is required to define va_list, and we shouldn't break ! * that. On IRIX 6.5, internal/wchar_core.h used to get its ! * definition of va_list from stdio.h. Since this doesn't happen any ! * longer, use __gnuc_va_list there, too. */ fix = { hackname = stdio_va_list; *************** fix = { *** 2716,2721 **** --- 2715,2723 ---- files = wchar.h; files = curses_colr/curses.h; bypass = '__gnuc_va_list|_BSD_VA_LIST_|__DJ_va_list|_G_va_list'; + /* Don't fix, if we use va_list from stdarg.h, or if the use is + otherwise protected. */ + bypass = 'include <stdarg\.h>|#ifdef va_start';

      /*
       * Use __gnuc_va_list in arg types in place of va_list.
--------------


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