From 2d46a052563c1d362bfe4fa3c8fac1a258ce4cc2 Mon Sep 17 00:00:00 2001 From: albert-github Date: Mon, 6 May 2019 11:49:41 +0200 Subject: Truncated warning message In case of extremely long warning messages (e.g. in case of overloaded methods with a lot of alternatives) the warning message is truncated due to the "limited" buffer size. By using `vsnprintf(NULL, 0, fmt, args)` it is possible to determine the length of the message based on format and actual arguments. `char text[bufSize]` cannot be used as some older compilers don't accept it. (reference: https://stackoverflow.com/questions/3919995/determining-sprintf-buffer-size-whats-the-standard/30909417#30909417) --- src/message.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/message.cpp b/src/message.cpp index 2f3a06f..2e3e41a 100644 --- a/src/message.cpp +++ b/src/message.cpp @@ -167,17 +167,25 @@ static void format_warn(const char *file,int line,const char *text) static void do_warn(bool enabled, const char *file, int line, const char *prefix, const char *fmt, va_list args) { if (!enabled) return; // warning type disabled - const int bufSize = 40960; - char text[bufSize]; int l=0; if (prefix) { - qstrncpy(text,prefix,bufSize); l=strlen(prefix); } + // determine needed buffersize based on: + // format + arguments + // prefix + // 1 position for `\0` + int bufSize = vsnprintf(NULL, 0, fmt, args) + l + 1; + char *text = (char *)malloc(sizeof(char) * bufSize); + if (prefix) + { + qstrncpy(text,prefix,bufSize); + } vsnprintf(text+l, bufSize-l, fmt, args); text[bufSize-1]='\0'; format_warn(file,line,text); + free(text); } void warn(const char *file,int line,const char *fmt, ...) -- cgit v0.12 From 42f27ec5dd754cc097fe44b9dfef486e854a821e Mon Sep 17 00:00:00 2001 From: albert-github Date: Mon, 6 May 2019 12:10:52 +0200 Subject: Missing white space in warning Some messages give a result in the form of: `'static ostream & operator<<(ostream &out, const EntityAuth &a)' at line 61 of fileD:/Fossies/ceph-14.2.1/src/auth/Auth.h` i.e. space was missing `file` and `D:` --- src/doxygen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/doxygen.cpp b/src/doxygen.cpp index 347cd2a..153b1cb 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -5611,7 +5611,7 @@ static bool findGlobalMember(Entry *root, warnMsg+=" '"; warnMsg+=substitute(md->declaration(),"%","%%"); warnMsg+="' at line "+QCString().setNum(md->getDefLine())+ - " of file"+md->getDefFileName()+"\n"; + " of file "+md->getDefFileName()+"\n"; } } warn(root->fileName,root->startLine,warnMsg); -- cgit v0.12 From 058e1a54ee5e8bd8a60c85af5ff1df68d87da3da Mon Sep 17 00:00:00 2001 From: Ton van den Heuvel Date: Mon, 6 May 2019 15:17:28 +0200 Subject: Fix #6906 Generate configvalues.h only as a dependency for the VHDL parser. Fixes a problem in combination with Ninja v1.9.0 because of duplicate rules for generating configvalues.h. --- addon/doxyapp/CMakeLists.txt | 8 -------- addon/doxyparse/CMakeLists.txt | 8 -------- src/CMakeLists.txt | 4 ++++ vhdlparser/CMakeLists.txt | 12 +++--------- 4 files changed, 7 insertions(+), 25 deletions(-) diff --git a/addon/doxyapp/CMakeLists.txt b/addon/doxyapp/CMakeLists.txt index a737711..0aaf465 100644 --- a/addon/doxyapp/CMakeLists.txt +++ b/addon/doxyapp/CMakeLists.txt @@ -1,11 +1,3 @@ -# configvalues.h -add_custom_command( - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/src/configgen.py -maph ${CMAKE_SOURCE_DIR}/src/config.xml > ${GENERATED_SRC}/configvalues.h - DEPENDS ${CMAKE_SOURCE_DIR}/src/config.xml ${CMAKE_SOURCE_DIR}/src/configgen.py - OUTPUT ${GENERATED_SRC}/configvalues.h -) -set_source_files_properties(${GENERATED_SRC}/configvalues.h PROPERTIES GENERATED 1) - find_package(Iconv) include_directories( diff --git a/addon/doxyparse/CMakeLists.txt b/addon/doxyparse/CMakeLists.txt index ff198fb..1620c72 100644 --- a/addon/doxyparse/CMakeLists.txt +++ b/addon/doxyparse/CMakeLists.txt @@ -1,11 +1,3 @@ -# configvalues.h -add_custom_command( - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/src/configgen.py -maph ${CMAKE_SOURCE_DIR}/src/config.xml > ${GENERATED_SRC}/configvalues.h - DEPENDS ${CMAKE_SOURCE_DIR}/src/config.xml ${CMAKE_SOURCE_DIR}/src/configgen.py - OUTPUT ${GENERATED_SRC}/configvalues.h -) -set_source_files_properties(${GENERATED_SRC}/configvalues.h PROPERTIES GENERATED 1) - find_package(Iconv) include_directories( diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 92a302a..37a21ff 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -43,6 +43,10 @@ add_custom_command( OUTPUT ${GENERATED_SRC}/configvalues.h ) set_source_files_properties(${GENERATED_SRC}/configvalues.h PROPERTIES GENERATED 1) +add_custom_target( + generate_configvalues_header + DEPENDS ${GENERATED_SRC}/configvalues.h +) # configvalues.cpp add_custom_command( diff --git a/vhdlparser/CMakeLists.txt b/vhdlparser/CMakeLists.txt index 71e97df..f89008c 100644 --- a/vhdlparser/CMakeLists.txt +++ b/vhdlparser/CMakeLists.txt @@ -1,14 +1,5 @@ -# configvalues.h -add_custom_command( - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/src/configgen.py -maph ${CMAKE_SOURCE_DIR}/src/config.xml > ${GENERATED_SRC}/configvalues.h - DEPENDS ${CMAKE_SOURCE_DIR}/src/config.xml ${CMAKE_SOURCE_DIR}/src/configgen.py - OUTPUT ${GENERATED_SRC}/configvalues.h -) -set_source_files_properties(${GENERATED_SRC}/configvalues.h PROPERTIES GENERATED 1) - include_directories(${CMAKE_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/qtools ${GENERATED_SRC}) add_library(vhdlparser STATIC -${GENERATED_SRC}/configvalues.h CharStream.cc ParseException.cc Token.cc @@ -17,3 +8,6 @@ VhdlParser.cc VhdlParserTokenManager.cc VhdlParserIF.cpp ) +add_dependencies(vhdlparser + generate_configvalues_header +) -- cgit v0.12 From 351ec59539e59780d35ce943546e01796f205189 Mon Sep 17 00:00:00 2001 From: albert-github Date: Tue, 7 May 2019 10:08:54 +0200 Subject: Travis build fails due to problem with cmake removed explicit loading of cmake --- .travis.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index e6b10c1..66e79a9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -56,9 +56,7 @@ before_script: if [ "${TRAVIS_OS_NAME}" == "linux" ] && [ ! "${OS_NAME}" == "linux-ppc64le" ]; then printf "[requires] libxml2/2.9.8@bincrafters/stable - libiconv/1.15@bincrafters/stable - [build_requires] - cmake_installer/3.10.0@conan/stable" >> conanfile.txt; + libiconv/1.15@bincrafters/stable >> conanfile.txt; fi; if [ "${TRAVIS_OS_NAME}" == "osx" ]; then printf "[requires] -- cgit v0.12 From 789828a0689edccb89f02233a445a7aa1e86b1da Mon Sep 17 00:00:00 2001 From: albert-github Date: Tue, 7 May 2019 10:12:29 +0200 Subject: Travis build fails due to problem with cmake Typo --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 66e79a9..8b84cbe 100644 --- a/.travis.yml +++ b/.travis.yml @@ -56,7 +56,7 @@ before_script: if [ "${TRAVIS_OS_NAME}" == "linux" ] && [ ! "${OS_NAME}" == "linux-ppc64le" ]; then printf "[requires] libxml2/2.9.8@bincrafters/stable - libiconv/1.15@bincrafters/stable >> conanfile.txt; + libiconv/1.15@bincrafters/stable" >> conanfile.txt; fi; if [ "${TRAVIS_OS_NAME}" == "osx" ]; then printf "[requires] -- cgit v0.12 From 6d1535c38fe6bdaa2a00fff0e7e43774a740a4ce Mon Sep 17 00:00:00 2001 From: albert-github Date: Tue, 7 May 2019 13:24:29 +0200 Subject: Bug 783759 - PERL_PATH config option: when is this needed? Still used? As, more or less, mentioned in the bug report: in version 1.7.6.1 the PERL_PATH is still in use (instdox.cpp) but in version 1.8.0 it is not used anymore, so the parameter has been set to obsolete now. --- Doxyfile | 1 - addon/doxmlparser/Doxyfile | 1 - addon/doxmlparser/Doxyfile.impl | 1 - doc/Doxyfile | 1 - examples/tag.cfg | 1 - qtools/Doxyfile | 1 - src/config.xml | 11 +---------- 7 files changed, 1 insertion(+), 16 deletions(-) diff --git a/Doxyfile b/Doxyfile index 8eabf0e..cc2aca7 100644 --- a/Doxyfile +++ b/Doxyfile @@ -276,7 +276,6 @@ GENERATE_TAGFILE = doxygen.tag ALLEXTERNALS = NO EXTERNAL_GROUPS = YES EXTERNAL_PAGES = YES -PERL_PATH = /usr/bin/perl #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- diff --git a/addon/doxmlparser/Doxyfile b/addon/doxmlparser/Doxyfile index faf4bee..e95ee76 100644 --- a/addon/doxmlparser/Doxyfile +++ b/addon/doxmlparser/Doxyfile @@ -146,7 +146,6 @@ SKIP_FUNCTION_MACROS = YES TAGFILES = ../../qtools_docs/qtools.tag=../../../../qtools_docs/html GENERATE_TAGFILE = ALLEXTERNALS = NO -PERL_PATH = #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- diff --git a/addon/doxmlparser/Doxyfile.impl b/addon/doxmlparser/Doxyfile.impl index a954db3..88818ab 100644 --- a/addon/doxmlparser/Doxyfile.impl +++ b/addon/doxmlparser/Doxyfile.impl @@ -148,7 +148,6 @@ TAGFILES = ../../qtools_docs/qtools.tag=../../../../qtools_docs/ht GENERATE_TAGFILE = ALLEXTERNALS = NO EXTERNAL_GROUPS = YES -PERL_PATH = #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- diff --git a/doc/Doxyfile b/doc/Doxyfile index 4c0a19d..7697d70 100644 --- a/doc/Doxyfile +++ b/doc/Doxyfile @@ -45,7 +45,6 @@ EXAMPLE_PATH = ../examples RECURSIVE = NO TAGFILES = ALLEXTERNALS = NO -PERL_PATH = /usr/bin/perl SEARCHENGINE = NO PDF_HYPERLINKS = YES USE_PDFLATEX = YES diff --git a/examples/tag.cfg b/examples/tag.cfg index 823b5a7..12b3c5b 100644 --- a/examples/tag.cfg +++ b/examples/tag.cfg @@ -6,7 +6,6 @@ GENERATE_RTF = NO CASE_SENSE_NAMES = NO INPUT = tag.cpp TAGFILES = example.tag=../../example/html -PERL_PATH = perl QUIET = YES JAVADOC_AUTOBRIEF = YES SEARCHENGINE = NO diff --git a/qtools/Doxyfile b/qtools/Doxyfile index af84df1..109d3dc 100644 --- a/qtools/Doxyfile +++ b/qtools/Doxyfile @@ -280,7 +280,6 @@ GENERATE_TAGFILE = ../qtools_docs/qtools.tag ALLEXTERNALS = NO EXTERNAL_GROUPS = YES EXTERNAL_PAGES = YES -PERL_PATH = /usr/bin/perl #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- diff --git a/src/config.xml b/src/config.xml index 8820fe7..0b26571 100644 --- a/src/config.xml +++ b/src/config.xml @@ -105,7 +105,6 @@ PROJECT_NAME = Example INPUT = example.cc example.h WARNINGS = YES TAGFILES = qt.tag -PERL_PATH = /usr/local/bin/perl SEARCHENGINE = NO \endverbatim @@ -120,7 +119,6 @@ INPUT = examples/examples.doc src FILE_PATTERNS = *.cc *.h INCLUDE_PATH = examples TAGFILES = qt.tag -PERL_PATH = /usr/bin/perl SEARCHENGINE = YES \endverbatim @@ -3229,14 +3227,6 @@ where `loc1` and `loc2` can be relative or absolute paths or URLs. ]]> - -- cgit v0.12