Uploaded image for project: 'ZooKeeper'
  1. ZooKeeper
  2. ZOOKEEPER-3654

Incorrect *_CFLAGS handling in Automake

    XMLWordPrintableJSON

Details

    Description

      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:

      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)

      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.)

      Attachments

        Issue Links

          Activity

            People

              ztzg Damien Diederen
              ztzg Damien Diederen
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 40m
                  1h 40m