Re: Wrong order of preprocessor and compiler flags

2022-03-24 Thread Alex Ameen
The rationale for placement of `CPPFLAGS` early is to allow users to better control include ordering. This is similar to why `CFLAGS` is last. Consider this situation : User wants to preempt the default include path, and wants to override the C standard. make CPPFLAGS='-Ifoo/bar' CFLAGS='-std=c1

Re: Wrong order of preprocessor and compiler flags

2022-03-24 Thread Evgeny Grin
On 24.03.2022 21:37, Nick Bowler wrote: On 2022-03-24, Zack Weinberg wrote: On Thu, Mar 24, 2022, at 11:13 AM, Nick Bowler wrote: However, GNU coding standards state that CFLAGS should be the last item on compilation commands, so it would appear that this is a case where traditional "make" beh

Re: Wrong order of preprocessor and compiler flags

2022-03-24 Thread Evgeny Grin
Let' move this discussion to the autoconf@gnu.org list Forwarded Message From: Evgeny Grin Sent: Thursday, March 24, 2022, 21:38 UTC+3 Subject: Wrong order of preprocessor and compiler flags I've found that everywhere in autoconf scripts flags are used like: $CC -c $CFLAGS $

Re: Wrong order of preprocessor and compiler flags

2022-03-24 Thread Evgeny Grin
On 24.03.2022 17:42, Bob Friesenhahn wrote: On Thu, 24 Mar 2022, Evgeny Grin wrote: It's not uncommon to use CFLAGS for macros or for '-I' flags. I think it's easy to imagine other conflicting situation where the order of used flags is significant. It may not be uncommon, but it is a usage b

Re: Wrong order of preprocessor and compiler flags

2022-03-24 Thread Carlos O'Donell
On 3/24/22 11:41, Sam James wrote: > > >> On 24 Mar 2022, at 14:42, Bob Friesenhahn >> wrote: >> >> On Thu, 24 Mar 2022, Evgeny Grin wrote: >>> >>> It's not uncommon to use CFLAGS for macros or for '-I' flags. I >>> think it's easy to imagine other conflicting situation where the >>> order of

Re: Wrong order of preprocessor and compiler flags

2022-03-24 Thread David A. Wheeler
> On Mar 24, 2022, at 3:47 AM, Evgeny Grin wrote: > > Hello, > > I've found that everywhere in autoconf scripts flags are used like: > $CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&AS_MESSAGE_LOG_FD > while automake and libtool use flags in the other order: > $(CC) $(DEFS) $(DEFAULT_INCLUDES) $

Re: Wrong order of preprocessor and compiler flags

2022-03-24 Thread Sam James
> On 24 Mar 2022, at 14:42, Bob Friesenhahn > wrote: > > On Thu, 24 Mar 2022, Evgeny Grin wrote: >> >> It's not uncommon to use CFLAGS for macros or for '-I' flags. >> I think it's easy to imagine other conflicting situation where the order of >> used flags is significant. > > It may not be

Re: Wrong order of preprocessor and compiler flags

2022-03-24 Thread Bob Friesenhahn
On Thu, 24 Mar 2022, Evgeny Grin wrote: It's not uncommon to use CFLAGS for macros or for '-I' flags. I think it's easy to imagine other conflicting situation where the order of used flags is significant. It may not be uncommon, but it is a usage bug to use CFLAGS for pre-processor options.

Wrong order of preprocessor and compiler flags

2022-03-24 Thread Evgeny Grin
Hello, I've found that everywhere in autoconf scripts flags are used like: $CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&AS_MESSAGE_LOG_FD while automake and libtool use flags in the other order: $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) Auto