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

error compiling ....in pine_gestures.cpp: In function 'int ftoi(char*)': compiling from sxmo-pinephone-postmarketOS #7

Open
billyblackburn opened this issue Mar 5, 2023 · 0 comments

Comments

@billyblackburn
Copy link

pine64-pinephone:~/pine_gestures$ make
g++ -std=c++11 -o pine_gestures pine_gestures.cpp
In file included from /usr/include/c++/12.2.1/cstring:42,
from pine_gestures.cpp:22:
pine_gestures.cpp: In function 'int ftoi(char*)':
pine_gestures.cpp:54:24: error: cannot convert 'std::nullptr_t' to 'int' in return
54 | return NULL;
| ^~~~
pine_gestures.cpp:59:24: error: cannot convert 'std::nullptr_t' to 'int' in return
59 | return NULL;
| ^~~~
pine_gestures.cpp: In function 'int get_arg(int, char**, char*, char*)':
pine_gestures.cpp:179:20: warning: format not a string literal and no format arguments [-Wformat-security]
179 | sprintf(arg_value, argv[i+1]);
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
pine_gestures.cpp: In function 'void usage(char*)':
pine_gestures.cpp:191:21: warning: format '%s' expects a matching 'char*' argument [-Wformat=]
191 | printf("Usage: %s [--shake_cmd ] [--twist_cmd ]\n");
| ~^
| |
| char*
pine_gestures.cpp: In function 'int main(int, char**)':
pine_gestures.cpp:204:35: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
204 | int ret = get_arg(argc, argv, "--shake_cmd", shake_command);
| ^~~~~~~~~~~~~
pine_gestures.cpp:213:31: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
213 | ret = get_arg(argc, argv, "--twist_cmd", twist_command);
| ^~~~~~~~~~~~~
pine_gestures.cpp:233:13: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
233 | if(find("/sys/bus/i2c/drivers/inv-mpu6050-i2c", "0068", IMU_path))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pine_gestures.cpp:233:53: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
233 | if(find("/sys/bus/i2c/drivers/inv-mpu6050-i2c", "0068", IMU_path))
| ^~~~~~
pine_gestures.cpp:235:28: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
235 | if(!find(IMU_path, "iio:device", IMU_path))
| ^~~~~~~~~~~~
pine_gestures.cpp:292:20: warning: format not a string literal and no format arguments [-Wformat-security]
292 | printf(shake_command);
| ^~~~~~~~~~~~~
pine_gestures.cpp:306:20: warning: format not a string literal and no format arguments [-Wformat-security]
306 | printf(twist_command);
| ^~~~~~~~~~~~~
pine_gestures.cpp: In function 'bool find(char*, char*, char*)':
pine_gestures.cpp:87:1: warning: control reaches end of non-void function [-Wreturn-type]
87 | }
| ^
make: *** [Makefile:31: pine_gestures] Error 1

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

1 participant