Re: Wrong order of preprocessor and compiler flags

2022-03-27 Thread Evgeny Grin
Sure, it's clear. I was looking for some consensus before moving to another list. As I haven't found any objections at least, I'll start discussion in the automake list. -- Evgeny On 27.03.2022 2:36, Peter Johansson wrote: On 25/3/22 17:33, Evgeny Grin wrote: As no 'make' implementation us

Re: Wrong order of preprocessor and compiler flags

2022-03-26 Thread Peter Johansson
On 25/3/22 17:33, Evgeny Grin wrote: As no 'make' implementation uses CPPFLAGS before CFLAGS [1], others [2] use $CFLAGS $CPPFLAGS as well, it makes sense to correct automake to align with other tools and leave autoconf without changes. If the suggestion is to change automake, you might ha

Re: Wrong order of preprocessor and compiler flags

2022-03-25 Thread Evgeny Grin
Hi Alex. Original Message From: Alex Ameen Sent: Friday, March 25, 2022, 03:45 UTC+3 Subject: Wrong order of preprocessor and compiler flags The rationale for placement of `CPPFLAGS` early is to allow users to better control include ordering. This is similar to why `CFLAGS

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

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