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

Fixing unused variable compiler warnings #514

Merged
merged 1 commit into from
Feb 18, 2014

Conversation

jkammerl
Copy link
Member

No description provided.

jspricke added a commit that referenced this pull request Feb 18, 2014
Fixing unused variable compiler warnings
@jspricke jspricke merged commit b74b4c2 into PointCloudLibrary:master Feb 18, 2014
@taketwo
Copy link
Member

taketwo commented Feb 18, 2014

We got a pile of new warnings in exchange :)

/home/travis/build/PointCloudLibrary/pcl/ml/src/svm.cpp: In function ‘svm_model* svm_load_model(const char*)’:
/home/travis/build/PointCloudLibrary/pcl/ml/src/svm.cpp:3265:29: warning: ignoring return value of ‘int fscanf(FILE*, const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
/home/travis/build/PointCloudLibrary/pcl/ml/src/svm.cpp:3269:31: warning: ignoring return value of ‘int fscanf(FILE*, const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
/home/travis/build/PointCloudLibrary/pcl/ml/src/svm.cpp:3294:33: warning: ignoring return value of ‘int fscanf(FILE*, const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
/home/travis/build/PointCloudLibrary/pcl/ml/src/svm.cpp:3318:43: warning: ignoring return value of ‘int fscanf(FILE*, const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
/home/travis/build/PointCloudLibrary/pcl/ml/src/svm.cpp:3321:45: warning: ignoring return value of ‘int fscanf(FILE*, const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
/home/travis/build/PointCloudLibrary/pcl/ml/src/svm.cpp:3324:47: warning: ignoring return value of ‘int fscanf(FILE*, const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
/home/travis/build/PointCloudLibrary/pcl/ml/src/svm.cpp:3327:52: warning: ignoring return value of ‘int fscanf(FILE*, const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
/home/travis/build/PointCloudLibrary/pcl/ml/src/svm.cpp:3330:47: warning: ignoring return value of ‘int fscanf(FILE*, const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
/home/travis/build/PointCloudLibrary/pcl/ml/src/svm.cpp:3338:57: warning: ignoring return value of ‘int fscanf(FILE*, const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
/home/travis/build/PointCloudLibrary/pcl/ml/src/svm.cpp:3347:60: warning: ignoring return value of ‘int fscanf(FILE*, const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
/home/travis/build/PointCloudLibrary/pcl/ml/src/svm.cpp:3356:63: warning: ignoring return value of ‘int fscanf(FILE*, const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
/home/travis/build/PointCloudLibrary/pcl/ml/src/svm.cpp:3365:65: warning: ignoring return value of ‘int fscanf(FILE*, const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
/home/travis/build/PointCloudLibrary/pcl/ml/src/svm.cpp:3374:64: warning: ignoring return value of ‘int fscanf(FILE*, const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
/home/travis/build/PointCloudLibrary/pcl/ml/src/svm.cpp:3383:63: warning: ignoring return value of ‘int fscanf(FILE*, const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]

@taketwo
Copy link
Member

taketwo commented Feb 18, 2014

Instead of removing int res I propose to compare it with zero to see if any data were read:

int res = fscanf (fp, "%80s", cmd);

if (res > 0 && strcmp (cmd, "svm_type") == 0)
{
   ...

@jspricke
Copy link
Member

@taketwo +1 on everything (I just merged it to make the problem obvious ;) ). Will you come up with a patch?
Btw. I think it's better to have this in a new issue next time, as this one is closed and tends to get lost.

@taketwo
Copy link
Member

taketwo commented Feb 18, 2014

Btw. I think it's better to have this in a new issue next time, as this one is closed and tends to get lost.

Good point.

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.

3 participants