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

Clang c++ compilation fixes #4739

Merged
merged 11 commits into from
Jan 9, 2024
Merged

Commits on Jan 9, 2024

  1. all: remove deprecated use of g_memdup()

    Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
    bazsi authored and alltilla committed Jan 9, 2024
    Configuration menu
    Copy the full SHA
    d3283ac View commit details
    Browse the repository at this point in the history
  2. all: avoid using the deprecated g_pattern_match and g_pattern_match_s…

    …tring functions
    
    Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
    bazsi authored and alltilla committed Jan 9, 2024
    Configuration menu
    Copy the full SHA
    630dac8 View commit details
    Browse the repository at this point in the history
  3. otel: fix unit test format string issue

    cr_assert() would expect arguments to the format string but they were
    not supplied. clang warns about this.
    
    Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
    bazsi authored and alltilla committed Jan 9, 2024
    Configuration menu
    Copy the full SHA
    3bc380a View commit details
    Browse the repository at this point in the history
  4. otel: compare floats using an epsilon to fix warnings

    Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
    bazsi authored and alltilla committed Jan 9, 2024
    Configuration menu
    Copy the full SHA
    85e1e79 View commit details
    Browse the repository at this point in the history
  5. cfg-grammar.y: disable a warning about yynerrs

    clang complained about an unreferenced local variable in the generated
    grammar.
    
    Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
    bazsi authored and alltilla committed Jan 9, 2024
    Configuration menu
    Copy the full SHA
    eb86a15 View commit details
    Browse the repository at this point in the history
  6. configure.ac: add checking for warning flags

    Not all warnings are supported everywhere, so check their presence from
    configure.ac before using them in Makefile.am.
    
    Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
    bazsi authored and alltilla committed Jan 9, 2024
    Configuration menu
    Copy the full SHA
    12f2fc4 View commit details
    Browse the repository at this point in the history
  7. lib/compat/cpp-start.h: add header ordering best practices

    Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
    bazsi authored and alltilla committed Jan 9, 2024
    Configuration menu
    Copy the full SHA
    8ea6323 View commit details
    Browse the repository at this point in the history
  8. cxx: implement header ordering best practices

    This makes sure syslog-ng.h and glib.h are included from outside
    of extern "C" blocks.
    
     * Header ordering:
     *   - syslog-ng.h needs to come first even in cpp/hpp files.  You don't
     *     need cpp-start/end wrapper around syslog-ng.h.  This include can
     *     happen indirectly, e.g.  if you include any other header that should
     *     take care of syslog-ng.h
     *
     *   - syslog-ng.h will include glib too, which is also C++ safe.  This is
     *     needed as some constructs in glib only work if it is outside of an
     *     extern "C" block.
     *
     *   - Use the usual header ordering conventions, e.g.  include the closest
     *     header first (e.g.  the one associated with your module) and then
     *     iterate to furthest.  This ensures that each header is actually
     *     standalone and includes all its dependencies.
     *
     *   - If you use a .hpp file, include .h from it and make sure the .h
     *     includes syslog-ng.h and includes all other .h files by wrapping them
     *     using cpp-start/end.h as needed. This takes care of the first rule.
     *
     *   - In your .cpp files, include the .hpp file but not the .h file which is
     *     already included.
    
    Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
    bazsi authored and alltilla committed Jan 9, 2024
    Configuration menu
    Copy the full SHA
    f1e7d08 View commit details
    Browse the repository at this point in the history
  9. configure/cmake: set GLIB_VERSION_MIN_REQUIRED to 2.68 if we have a r…

    …ecent glib
    
    This fixes clang++ compilation as explained here:
      https://gitlab.gnome.org/GNOME/glib/-/issues/3193#note_1935964
    
    Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
    bazsi authored and alltilla committed Jan 9, 2024
    Configuration menu
    Copy the full SHA
    44c0748 View commit details
    Browse the repository at this point in the history
  10. .github/workflows/devshell.yml: make sure we use the right C++ compil…

    …er associated with CC
    
    Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
    bazsi authored and alltilla committed Jan 9, 2024
    Configuration menu
    Copy the full SHA
    eff9c85 View commit details
    Browse the repository at this point in the history
  11. configure.ac: don't forcefully change the compiler

    Signed-off-by: Balazs Scheidler <balazs.scheidler@axoflow.com>
    bazsi authored and alltilla committed Jan 9, 2024
    Configuration menu
    Copy the full SHA
    46f8a25 View commit details
    Browse the repository at this point in the history