You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue:
SWIG or the generated C code by SWIG currently has no support for checking the Go
version in use.
Background:
During the discussion of issue #9065 [1] Ian pointed out that the current SWIG version no
longer works with Go 1.0.3 [2]. In general SWIG should support old Go versions for as
long as possible but sometimes support for old Go versions needs to be dropped because
of incompatibilities or bugs or in order to support new features.
Proposal:
runtime.h defines the Go version as a constant similarly to SWIG_VERSION [3] or the
often used GCC_VERSION [4] constant.
Possible use cases:
1) Clear error message to the user in case an unsupported Go version is in use. The C
code generated by SWIG can include a simple preprocessor check if the Go version in use
is supported and if it isn't fail via the #error directive and a clear error message.
2) New and optional features could be made available conditionally if the Go version in
use supports it. In case a Go version does not support a new feature a warning message
can be generated via the #warning preprocessor directive. CL 171270043 [5] would need to
be reverted though as currently warnings are ignored/hidden.
3) If there are incompatibilities between major Go versions (Go 1 vs. 2) then the
generated C code by SWIG could be made compatible to several major Go versions.
Links:
[1] https://golang.org/issue/9065
[2] https://golang.org/issue/9065?c=7
[3] http://www.swig.org/Doc3.0/SWIGDocumentation.html#Preprocessor_condition_compilation
[4]
https://gcc.gnu.org/onlinedocs/gcc-4.9.2/cpp/Common-Predefined-Macros.html#Common-Predefined-Macros4
[5] https://golang.org/cl/171270043
The text was updated successfully, but these errors were encountered:
I hope that this will not be an issue as we move past the Go 1.5 release. Since SWIG now depends only on documented interfaces, it should no longer be necessary to update SWIG for each new Go release, and after everybody is using Go 1.5 and SWIG 3.0.6 there should no longer be a concern about having a mismatch between SWIG and Go. I hope.
The text was updated successfully, but these errors were encountered: