diff --git a/Doc/Manual/SWIG.html b/Doc/Manual/SWIG.html index 8d8f7bd45..b7021c468 100644 --- a/Doc/Manual/SWIG.html +++ b/Doc/Manual/SWIG.html @@ -2528,6 +2528,45 @@ This section describes the behavior of SWIG when processing ISO C structures and handle C++ are described in the next section.

+

+ISO C has a separate tag name space in which the names of structures, +unions and enumerated types are put, which is separate from the +name space for ordinary identifiers (function names, object names, +typedef names, enumeration constants). For example, this is valid +ISO C because Foo the struct tag and Foo the function +name are in different name spaces: +

+ +
+struct Foo {
+  int bar;
+};
+
+int Foo(void) { return 42; }
+
+ +

+SWIG doesn't currently implement this separate tag name space and +for the above example you'll get: +

+ +
+foo.i:5: Warning 302: Identifier 'Foo' redefined (ignored),
+foo.i:1: Warning 302: previous definition of 'Foo'.
+
+ +

+In practice this rarely actually causes problems, particular because +SWIG has special handling for typedef so cases such as this +work: +

+ +
+typedef struct Foo {
+  int bar;
+} Foo;
+
+

If SWIG encounters the definition of a structure or union, it creates a set of accessor functions. Although SWIG does not need @@ -2539,8 +2578,7 @@ to an individual member. For example, the declaration :

 struct Vector {
   double x, y, z;
-}
-
+};