On Do, 2014-09-04 at 23:37 -0400, Sasha Levin wrote: > On 09/04/2014 07:47 PM, Joe Perches wrote: > > On Fri, 2014-09-05 at 00:43 +0200, Hannes Frederic Sowa wrote: > >> > Most statements are already depending on GCC_VERSION, maybe we can just > >> > unify all gcc specific headers to one, still trying to keep the file > >> > organized? ;) > > Maybe something like: > > > > gnu development of gcc will be more frequent and the use of > > compiler-gcc<major>.h likely will not be convenient anymore. > > > > Integrate the individual compiler-gcc<major>.h files into > > compiler-gcc.h. > > Please no. We have a similar file we maintain in our team that's supposed to > do something very similar for kernel versions. It goes all the way back to > 2.6.9 and it's a *horrible* mess. > > This is how compiler-gcc.h will end up looking in a while.
Something along these lines? We can make '4' a macro describing it references the latest possible compiler-gccX.h file. --- a/include/linux/compiler-gcc.h +++ b/include/linux/compiler-gcc.h @@ -103,7 +103,12 @@ #define __gcc_header(x) #x #define _gcc_header(x) __gcc_header(linux/compiler-gcc##x.h) #define gcc_header(x) _gcc_header(x) + +#if __GNUC__ > 4 +#include gcc_header(4) +#else #include gcc_header(__GNUC__) +#endif #if !defined(__noclone) #define __noclone /* not needed */ I still think we should start chaining newer gcc header files to deduplicate the content. What do you think? Bye, Hannes -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/