Page 1 of 1

lapacke.h uses // comments preventing compilation with -ansi

PostPosted: Mon Oct 13, 2014 11:17 am
by wryanlivingston
Hi all,

If one looks in LAPACK/lapacke/include/lapacke.h there are a few C++ style comments using "//" rather than "/* */". When including lapacke.h in a build that uses a strict C mode (e.g. -ansi with gcc) this results in compilation errors. Would it be feasible to turn those into /* */ comments?

Thanks,
W. Ryan Livingston

Code: Select all
/* foo.c */
#include "lapacke.h"

% gcc -c foo.c -I/path/to/LAPACK/lapacke/include/ -ansi
In file included from foo.c:14:0:
/local/lapacke/lapack-3.5.0/lapacke/include/lapacke.h:9903:1: error: expected identifier or '(' before '/' token
/local/lapacke/lapack-3.5.0/lapacke/include/lapacke.h:9903:10: error: too many decimal points in number
/local/lapacke/lapack-3.5.0/lapacke/include/lapacke.h:10342:1: error: expected identifier or '(' before '/' token
/local/lapacke/lapack-3.5.0/lapacke/include/lapacke.h:10342:10: error: too many decimal points in number
/local/lapacke/lapack-3.5.0/lapacke/include/lapacke.h:10656:1: error: expected identifier or '(' before '/' token
/local/lapacke/lapack-3.5.0/lapacke/include/lapacke.h:10656:10: error: invalid suffix "X.X" on floating constant
/local/lapacke/lapack-3.5.0/lapacke/include/lapacke.h:11677:1: error: expected identifier or '(' before '/' token
/local/lapacke/lapack-3.5.0/lapacke/include/lapacke.h:11677:11: error: too many decimal points in number
/local/lapacke/lapack-3.5.0/lapacke/include/lapacke.h:11718:11: error: too many decimal points in number
/local/lapacke/lapack-3.5.0/lapacke/include/lapacke.h:11750:11: error: invalid suffix "X.X" on floating constant
/local/lapacke/lapack-3.5.0/lapacke/include/lapacke.h:16028:1: error: expected identifier or '(' before '/' token
/local/lapacke/lapack-3.5.0/lapacke/include/lapacke.h:16028:11: error: too many decimal points in number
/local/lapacke/lapack-3.5.0/lapacke/include/lapacke.h:16273:1: error: expected identifier or '(' before '/' token
/local/lapacke/lapack-3.5.0/lapacke/include/lapacke.h:16273:11: error: too many decimal points in number
/local/lapacke/lapack-3.5.0/lapacke/include/lapacke.h:16413:1: error: expected identifier or '(' before '/' token
/local/lapacke/lapack-3.5.0/lapacke/include/lapacke.h:16413:11: error: too many decimal points in number

Re: lapacke.h uses // comments preventing compilation with -

PostPosted: Mon Oct 13, 2014 4:09 pm
by rodney
Ryan,

You could alternatively use the -std=c99 option to conform to the ISO C99 standard, which added // as a valid comment prefix.

Rodney