#18 Eliminate ICC remark on generated wrapper class

open
nobody
None
5
2012-01-20
2012-01-20
Jason Kankiewicz
No

The absence of an access control specifier on a generated wrapper class causes the ICC compiler to output a remark like the following:
.../Klass.pypp.cpp(13): remark #304: access control not specified ("public" by default)
struct Klass_wrapper : Klass, bp::wrapper< Klass > {
^
Adding an explicit access control specification like so "struct Klass_wrapper : public Klass, bp::wrapper< Klass > {..." prevents the ICC compiler from outputting the remark.

This annoyance was encountered in revision 1856.

Discussion

  • All base classes in the declaration must be preceded by an access control specifier in order to prevent the ICC compiler from outputting a remark like the following:
    .../Klass.pypp.cpp(13): remark #304: access control not specified ("public" by default)
    struct Klass_wrapper : public Klass, bp::wrapper< Klass > {
    ^

     
  • According to the Zen of Python, explicit is better than implicit so it's better to specify the intended access control explicitly than to rely on the language's implicit default.
    While the outputting of the remark could be disabled by an ICC compiler flag, doing so complicates one's build configuration, especially when ICC is just one of multiple compilers with which the generated source code is to be compiled.