Skip to content

Commit

Permalink
Add diagnose option "-Wno-stringop-overflow" option to avoid the comp…
Browse files Browse the repository at this point in the history
…iling error on gcc9

Add "-Wno-stringop-overflow" option to avoid the following error:

    orch.cpp: In member function 'ref_resolve_status Orch::resolveFieldRefArray(type_map&, const string&, swss::KeyOpFieldsValuesTuple&, std::vector<long unsigned int>&, std::string&)':
    orch.cpp:609:41: error: 'strlen' argument missing terminating nul [-Werror=stringop-overflow=]
      609 |                     object_name_list += string(&list_item_delimiter);
          |                                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
    In file included from orch.cpp:6:
    orch.h:25:12: note: referenced argument declared here
       25 | const char list_item_delimiter = ',';
          |            ^~~~~~~~~~~~~~~~~~~
    cc1plus: all warnings being treated as errors

According to CauldronDevelopmentLLC/cbang#29, this is an error from boost and can be suppressed by using this option

Signed-off-by: Stephen Sun <stephens@nvidia.com>
  • Loading branch information
stephenxs committed Jan 27, 2021
1 parent b42253a commit 5d32b62
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ CFLAGS_COMMON+=" -Wvariadic-macros"
CFLAGS_COMMON+=" -Wno-switch-default"
CFLAGS_COMMON+=" -Wno-long-long"
CFLAGS_COMMON+=" -Wno-redundant-decls"
CFLAGS_COMMON+=" -Wno-stringop-overflow"

AC_SUBST(CFLAGS_COMMON)

Expand Down

0 comments on commit 5d32b62

Please sign in to comment.