Skip to content
Draft
16 changes: 15 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,17 @@ if (NOT EXISTS "${CMAKE_SOURCE_DIR}/src/whereami/.git" )
message(FATAL_ERROR "The src/whereami git submodule is not initialised.\n Please run `git submodule update --init`")
endif()

# add warnings
if (MSVC)
add_compile_options(/W4)
# not yet: make warnings fatal
#add_compile_options(/W4 /WX)
else()
add_compile_options(-Wall -Wextra -pedantic)
# not yet: make warnings fatal
#add_compile_options(-Wall -Wextra -pedantic -Werror)
endif()

# create version string based on git metadata (based on https://github.com/nocnokneo/cmake-git-versioning-example)
# in case version.hpp does not exist (it is shipped in GDL tarballs but not stored in the repo)
if (NOT EXISTS "${CMAKE_SOURCE_DIR}/src/version.hpp")
Expand Down Expand Up @@ -187,7 +198,10 @@ check_include_file(malloc.h HAVE_MALLOC_H)
check_include_file(malloc/malloc.h HAVE_MALLOC_MALLOC_H)

# locale
check_include_file(locale.h HAVE_LOCALE_H)
check_include_file_cxx(clocale HAVE_LOCALE_H)
if (NOT HAVE_LOCALE_H)
message(FATAL_ERROR "Necessary c++ header clocale not found")
endif()

# std includes..
check_include_file(stdint.h HAVE_STDINT_H)
Expand Down
1 change: 0 additions & 1 deletion config.h.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#cmakedefine HAVE_LIBREADLINE 1
#cmakedefine HAVE_LIBWXWIDGETS 1
#cmakedefine HAVE_LIBZ 1
#cmakedefine HAVE_LOCALE_H 1
#cmakedefine HAVE_SBRK 1
#cmakedefine HAVE_MALLINFO 1
#cmakedefine HAVE_MALLINFO2 1
Expand Down
2 changes: 1 addition & 1 deletion src/accessdesc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ class DotAccessDescT
// no zeroing, here the new variable is created
// zero only for GDL_PTR and GDL_OBJ (because of ref counting)
if( top->Type() == GDL_PTR || top->Type() == GDL_OBJ)
newData=top->New( dim);//, BaseGDL::NOZERO);
newData=top->New(dim, BaseGDL::ZERO);//, BaseGDL::NOZERO);
else
newData=top->New( dim, BaseGDL::NOZERO);

Expand Down
71 changes: 35 additions & 36 deletions src/antlr/ANTLRException.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef INC_ANTLRException_hpp__
#define INC_ANTLRException_hpp__
#ifndef INC_ANTLRException_hpp_
#define INC_ANTLRException_hpp_

/* ANTLR Translator Generator
* Project led by Terence Parr at http://www.jGuru.com
Expand All @@ -10,50 +10,49 @@

#include <antlr/config.hpp>
#include <string>
#include <stdexcept>

#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
namespace antlr {
#endif

class ANTLR_API ANTLRException
{
class ANTLR_API ANTLRException : std::exception {
public:
/// Create ANTLR base exception without error message
ANTLRException() : text("")
{
}
/// Create ANTLR base exception with error message
ANTLRException(const ANTLR_USE_NAMESPACE(std)string& s)
: text(s)
{
}
virtual ~ANTLRException() throw()
{
}
/// Create ANTLR base exception without error message
ANTLRException() : msg("") {
}
/// Create ANTLR base exception with error message
ANTLRException(const ANTLR_USE_NAMESPACE(std)string &s)
: msg(s) {
}
virtual ~ANTLRException() throw() {
}

/** Return complete error message with line/column number info (if present)
* @note for your own exceptions override this one. Call getMessage from
* here to get the 'clean' error message stored in the text attribute.
*/
virtual ANTLR_USE_NAMESPACE(std)string toString() const
{
return text;
}
/**
* Return complete error message with line/column number info (if present)
*
* @note for your own exceptions override this one. Call getMessage from
* here to get the 'clean' error message stored in the text attribute.
*/
virtual ANTLR_USE_NAMESPACE(std)string toString() const {
return msg.what();
}

/** Return error message without additional info (if present)
* @note when making your own exceptions classes override toString
* and call in toString getMessage which relays the text attribute
* from here.
*/
virtual ANTLR_USE_NAMESPACE(std)string getMessage() const
{
return text;
}
private:
ANTLR_USE_NAMESPACE(std)string text;
/**
* Return error message without additional info (if present)
*
* @note when making your own exceptions classes override toString
* and call in toString getMessage which relays the text attribute
* from here.
*/
virtual ANTLR_USE_NAMESPACE(std)string getMessage() const {
return msg.what();
}
protected:
ANTLR_USE_NAMESPACE(std)runtime_error msg;
};
#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
}
#endif

#endif //INC_ANTLRException_hpp__
#endif //INC_ANTLRException_hpp_
Loading
Loading