Damien Diederen created ZOOKEEPER-3654:
------------------------------------------

             Summary: Incorrect *_CFLAGS handling in Automake
                 Key: ZOOKEEPER-3654
                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-3654
             Project: ZooKeeper
          Issue Type: Bug
          Components: c client
            Reporter: Damien Diederen


The {{Makefile.am}} distributed with the C client defines some per-target 
{{\*_CFLAGS}} and {{\*_CXXFLAGS}} variables.  These however, do not reference 
{{AM_CFLAGS}} (resp. AM_CXXFLAGS}}, which means that some options (notably 
{{-Wall}}) are missing when building subsets of the code.

Dixit the [Automake 
docs|https://www.gnu.org/software/automake/manual/html_node/Program-and-Library-Variables.html]:

{quote}
In compilations with per-target flags, the ordinary ‘AM_’ form of
the flags variable is _not_ automatically included in the
compilation (however, the user form of the variable _is_ included).
So for instance, if you want the hypothetical ‘maude’ compilations
to also use the value of ‘AM_CFLAGS’, you would need to write:

     maude_CFLAGS = ... your flags ... $(AM_CFLAGS)
{quote}

Restoring the flags, however, causes compilation failures (in the library) and 
a slew of new warnings (in the tests) which had not been noticed because of the 
missing options.  These errors/warnings have to be fixed before the flags can 
be tightened up.

(I have a preliminary patch, and am planning to submit a "pull request" soon.)



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to