Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused broken GetTypecode to allow building with GCC 8 #210

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

rebecca-palmer
Copy link

This template function is unused (not in any public headers and not called from within clSPARSE), and has always been non-instantiable (and hence unusable) as char[4] to char& is an invalid conversion.

Older GCC didn't notice as we never try (instantiating a class template only instantiates those member functions that are used), but in GCC 8 its existence is an error:

/build/clsparse-0.10.2.0/src/library/io/mm-reader.cpp: In member function 'char& MatrixMarketReader::GetTypecode()':
/build/clsparse-0.10.2.0/src/library/io/mm-reader.cpp:123:16: error: invalid conversion from 'char*' to 'char' [-fpermissive]
return Typecode;
^~~~~~~~
/build/clsparse-0.10.2.0/src/library/io/mm-reader.cpp:123:16: error: cannot bind rvalue '(char)((char*)(&((MatrixMarketReader*)this)->MatrixMarketReader::Typecode))' to 'char&'

An alternative to removal is to change the char & to char *. Both options build in Debian (gcc 8.2, clsparse 0.10.2.0, where this problem was previously reported), but have not been built in develop or tested anywhere.

This template function has always been non-instantiable as
char[4] to char& is an invalid conversion.  Older GCC didn't notice
as we never try, but in GCC 8 its existence is an error:
https://gcc.gnu.org/gcc-8/porting_to.html#hypothetical-instantiation
@rebecca-palmer rebecca-palmer changed the base branch from master to develop February 2, 2019 22:04
@rebecca-palmer
Copy link
Author

The Appveyor log looks like a missing dependency before it even got to my change - given the long period without commits, does it now also fail on unmodified develop?

Scanning dependencies of target OpenCL
[ 3%] Building C object CMakeFiles/OpenCL.dir/icd.c.obj
icd.c
c:\projects\clsparse-otonj\bin\opencl\icd.h(53) : fatal error C1083: Cannot open include file: 'CL/cl.h': No such file or directory
NMAKE : fatal error U1077: 'C:\PROGRA2\MICROS3.0\VC\bin\amd64\cl.exe' : return code '0x2'
Stop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant