Re: [PATCH] Fix Solaris Workshop Compiler issues

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Björn <B.Steinbrink@...>
Cc: Alex Riesen <raa.lkml@...>, Guido Ostkamp <git@...>, <git@...>
Date: Wednesday, November 14, 2007 - 8:30 pm

Björn Steinbrink <B.Steinbrink@gmx.de> writes:


Do you mean the "FLEX_ARRAY" thing?

You can ask for FLEX_ARRAY from the command line of your "make"
process.

There is this thing in git-compat-util.h

        #ifndef FLEX_ARRAY
        #if defined(__GNUC__) && (__GNUC__ < 3)
        #define FLEX_ARRAY 0
        #else
        #define FLEX_ARRAY /* empty */
        #endif
        #endif

The sources are written this way:

	struct foo {
        	... other members ...
                char last_member_that_is_flexible[FLEX_ARRAY];
	};

For older gcc, because we know about its lack of support, the
above turns into:

	struct foo {
        	... other members ...
                char last_member_that_is_flexible[0];
        }

But for recent enough compilers that grok the "flexible array
members", the above expands to:

	struct foo {
        	... other members ...
                char last_member_that_is_flexible[];
        }

Maybe your compiler needs -DFLEX_ARRAY=0 in CFLAGS?
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] Fix Solaris Workshop Compiler issues, Guido Ostkamp, (Wed Nov 14, 4:31 pm)
Re: [PATCH] Fix Solaris Workshop Compiler issues, Alex Riesen, (Wed Nov 14, 4:47 pm)
Re: [PATCH] Fix Solaris Workshop Compiler issues, Junio C Hamano, (Wed Nov 14, 5:25 pm)
Re: [PATCH] Fix Solaris Workshop Compiler issues, Guido Ostkamp, (Wed Nov 14, 7:21 pm)
Re: [PATCH] Fix Solaris Workshop Compiler issues, Alex Riesen, (Wed Nov 14, 7:28 pm)
Re: [PATCH] Fix Solaris Workshop Compiler issues, Junio C Hamano, (Wed Nov 14, 8:30 pm)
Re: [PATCH] Fix Solaris Workshop Compiler issues, Linus Torvalds, (Wed Nov 14, 8:44 pm)
Re: [PATCH] Fix Solaris Workshop Compiler issues, David Kastrup, (Wed Nov 14, 9:21 pm)
Re: [PATCH] Fix Solaris Workshop Compiler issues, Junio C Hamano, (Wed Nov 14, 11:27 pm)
Re: [PATCH] Fix Solaris Workshop Compiler issues, Linus Torvalds, (Wed Nov 14, 9:53 pm)
Re: [PATCH] Fix Solaris Workshop Compiler issues, Junio C Hamano, (Wed Nov 14, 8:46 pm)
[PATCH] Fix "identifier redeclared" compilation error with S..., Björn Steinbrink, (Wed Nov 14, 9:15 pm)
[PATCH] Add mkdtemp() workaround for Sun Solaris 10, Guido Ostkamp, (Fri Nov 16, 2:59 pm)
[RFH] Solaris portability, Junio C Hamano, (Fri Nov 16, 8:33 pm)
Re: [RFH] Solaris portability, Guido Ostkamp, (Sun Nov 18, 8:08 am)
Re: [RFH] Solaris portability, Junio C Hamano, (Sun Nov 18, 1:46 pm)