Solaris Studio 12.3 CC Preprocessor Issue With Empty Macro Arguments (Doc ID 1611806.1)

Last updated on AUGUST 03, 2016

Applies to:

Oracle Solaris Studio - Version 12.3 to 12.3 [Release 12]
Information in this document applies to any platform.

Symptoms

Oracle Studio 12.3
C++ 5.12 preprocessor

Oracle Studio 12.3 C++ with macros does not handle empty parameters correctly.

If we define the following header:

#define DEFINE_COLROW_NORM_FUNCS(PREFIX, RPREFIX, RTYPE) \
 extern RPREFIX##RowVector xcolnorms (const PREFIX##Matrix& m, RTYPE p) \
 { return column_norms (m, p); }

DEFINE_COLROW_NORM_FUNCS( , , double)
DEFINE_COLROW_NORM_FUNCS( , Double, double)
DEFINE_COLROW_NORM_FUNCS(Complex , , double)
DEFINE_COLROW_NORM_FUNCS(Complex , Double, double)

And we compile using -P option to generate preprocessed file (.i).

- Expected preprocessed source code (obtained with Oracle Solaris Studio 12.2 C++ compiler):

extern RowVector xcolnorms ( const Matrix & m , double p ) { return column_norms ( m , p ) ; }
extern DoubleRowVector xcolnorms ( const Matrix & m , double p ) { return column_norms ( m , p ) ; }
extern RowVector xcolnorms ( const ComplexMatrix & m , double p ) { return column_norms ( m , p ) ; }
extern DoubleRowVector xcolnorms ( const ComplexMatrix & m , double p ) { return column_norms ( m , p ) ; }

- Actual preprocessed source code generated by Oracle Solaris Studio 12.3 C++ compiler:

externRowVector xcolnorms ( constMatrix & m , double p ) { return column_norms ( m , p ) ; }
extern DoubleRowVector xcolnorms ( constMatrix & m , double p ) { return column_norms ( m , p ) ; }
externRowVector xcolnorms ( const ComplexMatrix & m , double p ) { return column_norms ( m , p ) ; }
extern DoubleRowVector xcolnorms ( const ComplexMatrix & m , double p ) { return column_norms ( m , p ) ; }

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms