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

CppDemo.cpp narrowing conversion #4

Open
ollelogdahl opened this issue Jul 6, 2020 · 1 comment
Open

CppDemo.cpp narrowing conversion #4

ollelogdahl opened this issue Jul 6, 2020 · 1 comment

Comments

@ollelogdahl
Copy link

ollelogdahl commented Jul 6, 2020

Running make after ./configure with all example projects, make exits with errorcode 2.

CppDemo/CppDemo.cpp:50:1: error: narrowing conversion of ‘-1’ from ‘int’ to ‘long unsigned int’ [-Wnarrowing]

It is thrown by negative integers in an unsigned long int array.

@niiiksh
Copy link

niiiksh commented Nov 2, 2020

@ollelogdahl as a workaround I found a solution to use
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wnarrowing"

//narrowing error code

#pragma GCC diagnostic pop

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

No branches or pull requests

2 participants