[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Lintian warning: hardening-no-fortify-functions & version numbering

2012/6/23 Adam Borowski wrote:

>> Correct me if I'm wrong, but IIRC the CPPFLAGS have nothing to do with C++.
>> They're for `cpp` tool which is "The C PreProcessor" (check `man cpp`).
>> So as far as I understand cmake (and every other build system) MUST ignore
>> the CPPFLAGS, right?
> They SHOULD include CPPFLAGS.

You mean that they should run `cpp` even if they don't need it?

Or you mean that they should run `gcc`/`g++` with CPPFLAGS?
If you do, then... How should they do that? I.e. if I specify:
  CPPFLAGS="blablabla hehehe hohoho"
How should build system run gcc? Like that?
  gcc blablabla hehehe hohoho -c test.o test.c
or like that?:
  gcc -Wp,blablabla -Wp,hehehe -Wp,hohoho -c test.o test.c
or like that?:
  gcc -Wp,blablabla,hehehe,hohoho -c test.o test.c
or like that?:
  gcc -Wp,"blablabla hehehe hohoho" -c test.o test.c

It's not that obvious, after all. :)

>> Is there a bug somewhere causing CPPFLAGS to be used by g++? Is that
>> a typo on wiki? Or am I missing something?
> Both gcc and g++ preprocess the source first.

Ok, I'll put the question in other way. As _I_ understand the meaning of
CFLAGS, CXXFLAGS and CPPFLAGS it's actually very easy:
* CFLAGS go to gcc (or e.g. clang)
* CXXFLAGS go to g++ (or e.g. clang++)
* CPPFLAGS go to cpp (have no idea what would that be for clang/llvm)
That's all. And that's why I never used CPPFLAGS myself. If I'm wrong
(very probably) can you, please, correct me and point to some
documentation/standard/etc. explaining how CPPFLAGS should be used by
the build system?

Is there a standard common for all the build systems? Or some kind of
recommendation? Or it's just a coincidence that all the build systems
use same environment variable CFLAGS?


Reply to: