Skip to content

Commit

Permalink
Fix ODR violations
Browse files Browse the repository at this point in the history
Detected by compiling with GCC flags `-flto -Wodr`.
  • Loading branch information
ojwb committed Sep 20, 2021
1 parent 45ebd33 commit 561a1d8
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Source/Modules/overload.cxx
Expand Up @@ -21,13 +21,15 @@
String *argv_template_string;
String *argc_template_string;

namespace {
struct Overloaded {
Node *n; /* Node */
int argc; /* Argument count */
ParmList *parms; /* Parameters used for overload check */
int error; /* Ambiguity error */
bool implicitconv_function; /* For ordering implicitconv functions*/
};
}

static int fast_dispatch_mode = 0;
static int cast_dispatch_mode = 0;
Expand Down
3 changes: 2 additions & 1 deletion Source/Modules/python.cxx
Expand Up @@ -93,6 +93,7 @@ static int nortti = 0;
static int relativeimport = 0;

/* flags for the make_autodoc function */
namespace {
enum autodoc_t {
AUTODOC_CLASS,
AUTODOC_CTOR,
Expand All @@ -103,7 +104,7 @@ enum autodoc_t {
AUTODOC_CONST,
AUTODOC_VAR
};

}

static const char *usage1 = "\
Python Options (available with -python)\n\
Expand Down
3 changes: 2 additions & 1 deletion Source/Modules/r.cxx
Expand Up @@ -1301,13 +1301,14 @@ void R::addAccessor(String *memberName, Wrapper *wrapper, String *name,

#define MAX_OVERLOAD 256

namespace {
struct Overloaded {
Node *n; /* Node */
int argc; /* Argument count */
ParmList *parms; /* Parameters used for overload check */
int error; /* Ambiguity error */
};

}

List * R::Swig_overload_rank(Node *n,
bool script_lang_wrapping) {
Expand Down
2 changes: 2 additions & 0 deletions Source/Modules/ruby.cxx
Expand Up @@ -116,6 +116,7 @@ class RClass {


/* flags for the make_autodoc function */
namespace {
enum autodoc_t {
AUTODOC_CLASS,
AUTODOC_CTOR,
Expand All @@ -127,6 +128,7 @@ enum autodoc_t {
AUTODOC_SETTER,
AUTODOC_NONE
};
}

static const char *usage = "\
Ruby Options (available with -ruby)\n\
Expand Down

0 comments on commit 561a1d8

Please sign in to comment.