1. 16 Apr, 2019 1 commit
  2. 08 Feb, 2019 1 commit
  3. 04 Feb, 2019 1 commit
  4. 18 Sep, 2018 1 commit
  5. 07 Aug, 2018 2 commits
  6. 17 Jul, 2018 2 commits
    • Thomas Haller's avatar
      build: pass -std=gnu99 to compiler · b9bc20f4
      Thomas Haller authored
      With --enable-more-warnings, we already used -std=gnu99, see
      commit ba2b2de3.
      
      Compilation may behave differently depending on the selected
      C standard that we choose. It seems wrong, with more-warnings,
      to build against a C standard, while otherwise leaving it undefind.
      
      Indeed, one might argue, that our build system should not use
      such compiler specific options. At least, not without detecting
      support for the compiler option during ./configure.
      
      However:
      
      - we already did this for --enable-more-warnings.
      
      - we should not program against a theoretical compiler. In practice,
        only gcc and clang works to build NetworkManager. Both these compilers
        support this option, so there is no reason to not use it. If we ever
        come into the situation to support another compiler, adjusting -std=gnu99
        will be the smallest problem. Until that happens (and that's far from
        imminent), don't pretend to be portable to non-existing compilers and
        use the flag that in practice is available.
      
      See-also: https://gcc.gnu.org/onlinedocs/gcc/Standards.html
      b9bc20f4
    • Thomas Haller's avatar
      m4/trivial: fix indentation · cc12413c
      Thomas Haller authored
      cc12413c
  7. 16 Feb, 2018 1 commit
    • Lubomir Rintel's avatar
      m4: parametrize flags variable · 0999ebdf
      Lubomir Rintel authored
      Make it possible to add compiler options to a different variable than
      CFLAGS. This is useful to conditionally disable a compiler warning for a
      subpart of a tree.
      0999ebdf
  8. 08 Feb, 2018 1 commit
  9. 07 Feb, 2018 2 commits
  10. 18 Dec, 2017 1 commit
  11. 15 Dec, 2017 1 commit
    • Thomas Haller's avatar
      build: add "-Wvla" to warn about uses of variable-length arrays · 9c3402aa
      Thomas Haller authored
      We don't use them, so add a compiler warning about their use.
      I think they are annoying, because sizeof(x) and typeof(x) might
      evaluate at runtime. Especially the typeof() extension is useful
      for macros, but behaves badly with variable-length arrays due to
      running code at runtime.
      
      But the worst is, G_STATIC_ASSERT() is implemented by declaring
      an array of negative length. Usually, the checked condition should
      be a compile time constant, but with VLAs the compiler would not evaluate
      the static-assert at compile time and instead accept it silently. It's easy
      to mess up static asserts to wrongly have a non-constant condition,
      especially when the static-assert is used inside a macro.
      
      Just say no.
      9c3402aa
  12. 20 Oct, 2017 1 commit
  13. 18 May, 2017 1 commit
  14. 18 Apr, 2017 1 commit
    • Lubomir Rintel's avatar
      m4: disable -Wmissing-braces for newer clang · 928d68d0
      Lubomir Rintel authored
        src/NetworkManagerUtils.c:347:18: error: suggest braces around initialization of subobject [-Werror,-Wmissing-braces]
                NMIPAddr a1 = { 0 }, a2 = { 0 };
                                ^
                                {}
      
      Should we initialize unions this way? I think it's all right -- the initializer
      works well and { { { 0 } } } is probably not what we'd like to see.
      
      (cherry picked from commit 43012156)
      928d68d0
  15. 15 Apr, 2017 1 commit
    • Lubomir Rintel's avatar
      m4: disable -Wmissing-braces for newer clang · 43012156
      Lubomir Rintel authored
        src/NetworkManagerUtils.c:347:18: error: suggest braces around initialization of subobject [-Werror,-Wmissing-braces]
                NMIPAddr a1 = { 0 }, a2 = { 0 };
                                ^
                                {}
      
      Should we initialize unions this way? I think it's all right -- the initializer
      works well and { { { 0 } } } is probably not what we'd like to see.
      43012156
  16. 10 Feb, 2017 2 commits
  17. 06 Feb, 2017 5 commits
  18. 19 Jan, 2017 1 commit
  19. 18 Jan, 2017 1 commit
  20. 10 Nov, 2016 1 commit
    • Thomas Haller's avatar
      build: allow using GCC C99 dialect instead of C89 · ba2b2de3
      Thomas Haller authored
      We already use several GCC extenions, like typeof() and
      __attribute__((cleanup)). They are too convinient to miss
      and every supported compiler must support these.
      Currently, gcc and clang does. Maybe other compilers would
      support that too, but who knows, nobody seems to test that.
      
      We also already use stdbool.h (C99) and the imported systemd
      code is mostly gnu99 too (it's not clear to me, because I don't
      find it precisely documented. Certainly it makes use of C99 features
      too).
      
      C99/gnu99 has some nice improvements that we no longer should miss
      out. For example "flexible array members" or "variable declaration
      in init-part of for loop".
      
      It doesn't mean we have to use every obscure (badly supported?)
      feature, it means we don't have to forgo features that are well
      supported. C99 is 17 years old, I mean, really...
      
      If somebody comes along and ports NM to non-gcc/clang, we can address
      bugs about unsupported language features as they surface.
      But let's not restrict us to some hypothetical compiler (or language
      specification).
      
      Also, NetworkManager is not ported on environment beside Linux.
      We don't have to be so considerate about the required build environment.
      Gcc is probably the most portable compiler out there. I doubt porting
      NetworkManager to *BSD fails due to missing gnu99 features. And if that
      causes issues, we should fix them after they happen in practice.
      ba2b2de3
  21. 14 Sep, 2016 1 commit
    • Thomas Haller's avatar
      build: move detection of NM_GIT_SHA to separate "m4/git-sha-record.m4" · b33aacbc
      Thomas Haller authored
      We want to embed the current commit-id in the ./configure script.
      That way the generated ./configure file in the source tarball
      references the commit-id from which the tarball was created.
      
      Then, in a second step, a script can check ./configure to find
      the parent commit. This is for example done by the 'makerepo.sh'
      script.
      
      This is generally useful, and also done by network-manager-applet
      and libnl3 projects. Move the function to a separate m4 macro
      to reuse it. It should also be re-used in NetworkManager's VPN plugins.
      b33aacbc
  22. 06 Jun, 2016 1 commit
  23. 03 Jun, 2016 3 commits
  24. 18 May, 2016 3 commits
  25. 09 Mar, 2016 1 commit
  26. 04 Mar, 2016 1 commit
  27. 10 Nov, 2015 1 commit
    • Thomas Haller's avatar
      build: hack around compiler warning in g-ir-scanner · f6272144
      Thomas Haller authored
      The autoconf macro for GIR passes $CFLAGS to g-ir-scanner.
      g-ir-scanner extends those flags with the system-default which
      includes -D_FORTIFY_SOURCE=2. Probably it should not do that,
      but if you disable optimization, this results in a compler warning
      in "/usr/include/features.h" [1]
      
          export CFLAGS='-O0'
          # Happens both with clang or gcc.
          #export CC=clang
          git clean -fdx
          ./autogen.sh
          make
      
      Work around that by injecting -Wno-error to $CFLAGS when invoking
      g-ir-scanner.
      
      [1] Related: https://sourceware.org/bugzilla/show_bug.cgi?id=13979
      f6272144
  28. 29 Sep, 2015 1 commit
    • Lubomir Rintel's avatar
      build: set -Werror when checking whether a -W<warning> option works · b38bc157
      Lubomir Rintel authored
      Otherwise the check is effectively a no-op and unknown options still get
      turned on. This results in unknown warnings when build without
      --with-extra-warnings=error:
      
        warning: unknown warning option '-Wno-unused-but-set-variable'; did you mean '-Wno-unused-const-variable'? [-Wunknown-warning-option]
      b38bc157