Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/{snap-confine,libsnap-confine-private,snap-shutdown}: cleanup low-level C bits #4153

Merged
merged 14 commits into from
Nov 7, 2017

Commits on Nov 6, 2017

  1. cmd: enable more compiler warnings

    Bump the number of warning issue by compiler.
    
    Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
    bboozzoo committed Nov 6, 2017
    Configuration menu
    Copy the full SHA
    c3f581a View commit details
    Browse the repository at this point in the history
  2. snap-confine, system-shutdown, libsnap-confine-private: use void when…

    … symbol takes no paramters, make symbols static
    
    Make sure to use void in parameter list when a function takes no paramters.
    Otherwise the symbol can take any number of parameters. Where possible, make
    symbols static.
    
    Fixes 'function declaration isn’t a prototype [-Wstrict-prototypes]' warnings.
    
    Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
    bboozzoo committed Nov 6, 2017
    Configuration menu
    Copy the full SHA
    c6ceaeb View commit details
    Browse the repository at this point in the history
  3. snap-confine: fix comparison of signed with unsigned

    Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
    bboozzoo committed Nov 6, 2017
    Configuration menu
    Copy the full SHA
    1e407d3 View commit details
    Browse the repository at this point in the history
  4. libsnap-confine-private: fix comparison of signed with unsigned

    Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
    bboozzoo committed Nov 6, 2017
    Configuration menu
    Copy the full SHA
    668b676 View commit details
    Browse the repository at this point in the history
  5. libsnap-confine-private: reformat F() macro, include do-while braces

    Reformat the F() macro to make it readable. Make sure to include braces braces
    in do-while statement.
    
    Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
    bboozzoo committed Nov 6, 2017
    Configuration menu
    Copy the full SHA
    70d6c93 View commit details
    Browse the repository at this point in the history
  6. libsnap-confine-private: do not use nested functions

    Nested functions are not supported outside of gcc. Refactor the code using this
    feature.
    
    Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
    bboozzoo committed Nov 6, 2017
    Configuration menu
    Copy the full SHA
    fd8f5fb View commit details
    Browse the repository at this point in the history
  7. tests/unit/c-unit-tests: rename to unit-tests-gcc to indicate that te…

    …sts are gcc specific
    
    Rename the test to indicate that it is GCC specific
    
    Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
    bboozzoo committed Nov 6, 2017
    Configuration menu
    Copy the full SHA
    706a213 View commit details
    Browse the repository at this point in the history
  8. tests/unit/c-unit-tests-clang: unit tests of C code built with clang

    Introduce a test that builds the low-level C bits with clang and runs unit
    tests. This should ensure code can also be built with clang and we get an early
    heads up if gcc specific bits are incoming.
    
    Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
    bboozzoo committed Nov 6, 2017
    Configuration menu
    Copy the full SHA
    597029b View commit details
    Browse the repository at this point in the history
  9. cmd: properly set CHECK_CFLAGS for libsnap-confine-private.a and its …

    …unit tests
    
    Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
    bboozzoo committed Nov 6, 2017
    Configuration menu
    Copy the full SHA
    b6d40fc View commit details
    Browse the repository at this point in the history
  10. cmd/libsnap-confine-private: cleanup remaining declaration isn't prot…

    …otype warnings
    
    Fixes 'function declaration isn’t a prototype [-Wstrict-prototypes]' warnings.
    
    Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
    bboozzoo committed Nov 6, 2017
    Configuration menu
    Copy the full SHA
    2ed4577 View commit details
    Browse the repository at this point in the history
  11. cmd: make enabled C compiler warnings become error when building with…

    … unit tests
    
    This will allow us to catch warnings as part of CI pipeline
    
    Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
    bboozzoo committed Nov 6, 2017
    Configuration menu
    Copy the full SHA
    efd8081 View commit details
    Browse the repository at this point in the history
  12. cmd/autogen: allow passing of build directory through BUILD_DIR env v…

    …ariable
    
    Allow passing of desired build directory path in BUILD_DIR environment variable.
    
    Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
    bboozzoo committed Nov 6, 2017
    Configuration menu
    Copy the full SHA
    59cfa18 View commit details
    Browse the repository at this point in the history
  13. tests/unit/c-unit-tests-{gcc,clang}: refactor execute step to use aut…

    …ogen.sh
    
    Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
    bboozzoo committed Nov 6, 2017
    Configuration menu
    Copy the full SHA
    5e34947 View commit details
    Browse the repository at this point in the history

Commits on Nov 7, 2017

  1. cmd/snap-confine/apparmor-support: fix implicit fallthrough

    ENOENT case is not expected to fall through.
    
    Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
    bboozzoo committed Nov 7, 2017
    Configuration menu
    Copy the full SHA
    f352040 View commit details
    Browse the repository at this point in the history