]> git.openfabrics.org - ~adrianc/mstflint.git/commitdiff
fixed compilation issues against gcc6
authorAdrian Chiris <adrianc@mellanox.com>
Tue, 15 Nov 2016 09:43:09 +0000 (11:43 +0200)
committerAdrian Chiris <adrianc@mellanox.com>
Tue, 15 Nov 2016 09:43:09 +0000 (11:43 +0200)
configure.ac
ext_libs/muparser/Makefile.am
mlxconfig/Makefile.am
mlxconfig/mlxcfg_generic_commander.cpp
mlxconfig/mlxcfg_parser.cpp
mlxconfig/mlxcfg_ui.cpp

index c7820a15ffd205c4a024330d54d6e39efa0b962f..64d0b7bc08c7544fdf13403fd47b74245c603686 100644 (file)
@@ -15,7 +15,7 @@ AM_INIT_AUTOMAKE
 dnl Checks for programs
 AC_PROG_CC
 AC_PROG_CXX
-AM_PROG_AR
+m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
 AC_PROG_LIBTOOL
 AC_CONFIG_HEADERS( config.h )
 
index a94f0e418e99e991b7939ab09400d007027bcad3..9647361283d5ea92a59e3018506824e9e91295a3 100644 (file)
@@ -31,7 +31,7 @@
 #--
 # Makefile.am -- Process this file with automake to produce Makefile.in
 
-AM_CFLAGS = -W -Werror -g -MP -MD ${COMPILER_FPIC} 
+AM_CXXFLAGS = -W -Werror -g -MP -MD ${COMPILER_FPIC} -Wno-deprecated-declarations
 
 noinst_LIBRARIES = libmuparser.a
 noinst_HEADERS = muParser.h muParserBase.h muParserBytecode.h muParserCallback.h muParserDef.h muParserError.h muParserFixes.h muParserStack.h muParserToken.h muParserTokenReader.h muParserTemplateMagic.h
index c5cc075815652edf48c243652b314349dc1cb3fb..39d3b01f035307daf59018bf63996dd81af3303f 100755 (executable)
@@ -48,7 +48,7 @@ AM_CPPFLAGS = -I. -I$(USER_DIR) -I$(top_srcdir)/include/mtcr_ul -I$(MTCR_DIR) -I
            -I $(LAYOUTS_DIR) -I $(UTILS_DIR) -I$(DEV_MGT_DIR) -I$(CMDIF_DIR)
 
 
-AM_CXXFLAGS = -Wall -W -g -MP -MD -pipe  -DDATA_PATH=\"$(pkgdatadir)\"
+AM_CXXFLAGS = -Wall -W -g -MP -MD -pipe  -Wno-deprecated-declarations -DDATA_PATH=\"$(pkgdatadir)\"
 bin_PROGRAMS = mstconfig
 
 mstconfig_LDADD = $(UTILS_LIB) $(EXT_LIB_DIR)/sqlite/libsqlite3.a $(EXT_LIB_DIR)/muparser/libmuparser.a\
index 2c4f4f9fc8c20dd2a0b8eaeefb13bce884e8e8d6..a631e55f37ccd8c9875d15fa19ea33b41fac42d2 100644 (file)
@@ -62,8 +62,8 @@ using namespace std;
 #define XML_ROOT "config"
 
 #define XML_DOCUMENT_START  "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"\
-        "<"XML_ROOT" xmlns=\"" XMLNS "\">"
-#define XML_DOCUMENT_END "</"XML_ROOT">"
+        "<" XML_ROOT " xmlns=\"" XMLNS "\">"
+#define XML_DOCUMENT_END "</" XML_ROOT ">"
 #define XML_COMMENT_NODE "comment"
 
 #define IGNORE_IF_EMPTY_NODE(n) \
@@ -841,7 +841,7 @@ void GenericCommander::raw2XML(vector<string> lines, string& xmlTemplate)
     //check fingerprint in first line
     vector<string>::iterator it = lines.begin();
     if (*it != RAW_FILE_FINGERPRINT) {
-        throw MlxcfgException("Raw Content Fingerprint "RAW_FILE_FINGERPRINT" is missing or incorrect");
+        throw MlxcfgException("Raw Content Fingerprint " RAW_FILE_FINGERPRINT " is missing or incorrect");
     }
 
     it++;
@@ -877,7 +877,7 @@ void GenericCommander::raw2XML(vector<string> lines, string& xmlTemplate)
         throw MlxcfgException("No TLV configurations were found in the raw file");
     }
 
-    xmlTemplate += "</"XML_ROOT">";
+    xmlTemplate += "</" XML_ROOT ">";
     //printf("xmlTemplate=\n%s", xmlTemplate.c_str());
 }
 
index ebb5d390911762718f28a0f8f15ce59299966bde..76955fef249819d8778fadcae7b37e80f0cbfd85 100644 (file)
@@ -121,10 +121,10 @@ void MlxCfg::printHelp()
     // print usage examples
     printf("\n");
     printf(IDENT"Examples:\n");
-    printf(IDENT2"%-35s: %s\n", "To query current configuration", MLXCFG_NAME" -d "MST_DEV_EXAMPLE" query");
-    printf(IDENT2"%-35s: %s\n", "To set configuration", MLXCFG_NAME" -d "MST_DEV_EXAMPLE" set SRIOV_EN=1 NUM_OF_VFS=16 WOL_MAGIC_EN_P1=1");
-    printf(IDENT2"%-35s: %s\n", "To set raw configuration", MLXCFG_NAME" -d "MST_DEV_EXAMPLE2" -f conf_file set_raw");
-    printf(IDENT2"%-35s: %s\n", "To reset configuration", MLXCFG_NAME" -d "MST_DEV_EXAMPLE" reset");
+    printf(IDENT2"%-35s: %s\n", "To query current configuration", MLXCFG_NAME " -d " MST_DEV_EXAMPLE " query");
+    printf(IDENT2"%-35s: %s\n", "To set configuration", MLXCFG_NAME " -d " MST_DEV_EXAMPLE " set SRIOV_EN=1 NUM_OF_VFS=16 WOL_MAGIC_EN_P1=1");
+    printf(IDENT2"%-35s: %s\n", "To set raw configuration", MLXCFG_NAME " -d " MST_DEV_EXAMPLE2 " -f conf_file set_raw");
+    printf(IDENT2"%-35s: %s\n", "To reset configuration", MLXCFG_NAME " -d " MST_DEV_EXAMPLE " reset");
     printf("\n");
     printf(IDENT"Supported devices:\n");
     printf(IDENT2"4th Generation devices: ConnectX3, ConnectX3-Pro (FW 2.31.5000 and above).\n");
@@ -316,7 +316,7 @@ mlxCfgStatus MlxCfg::parseArgs(int argc, char* argv[])
     }
     // we parsed input until the set/query/reset cmd
     if (i == argc && _mlxParams.cmd == Mc_Set) {
-        return err(true, "missing configuration arguments. For more information please run "MLXCFG_NAME" -h|--help.");
+        return err(true, "missing configuration arguments. For more information please run " MLXCFG_NAME " -h|--help.");
     }
     if (i != argc && (_mlxParams.cmd == Mc_Reset || _mlxParams.cmd == Mc_Query)) {
         return err(true, "%s command expects no argument but %d argument recieved", (_mlxParams.cmd == Mc_Reset) ? "reset" : "query", argc -i);
index ef2906e8acda48a2c41750e25b2f9faa0fab3682..df49c8645011cd4bef5f8108dafcc969080b82bf 100644 (file)
@@ -839,7 +839,7 @@ mlxCfgStatus MlxCfg::writeNVOutputFile(vector<u_int32_t> content)
                 _mlxParams.NVOutputFile.c_str());
     }
     for (u_int32_t i = 0 ; i < content.size() * 4; i += 4) {
-        fwrite(((u_int8_t*)content.data()) + i ,1 , 4 , file);
+        (void) fwrite(((u_int8_t*)content.data()) + i ,1 , 4 , file);
         if (ferror(file)) {
             fclose(file);
             return err(true, "Write failed: %s.", strerror(errno));