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

Invalid conversion from 'void (*)()' to 'void (*)(char*) compilation errors #2

Closed
Twilight-Logic opened this issue Feb 10, 2019 · 5 comments

Comments

@Twilight-Logic
Copy link
Owner

..does not compile. Errors are
AR488-0-45-10:758: error: invalid conversion from 'void ()()' to 'void ()(char*)' [-fpermissive]
plenty of them..
AR488-0-45-10:758: error: invalid conversion from 'void ()()' to 'void ()(char*)' [-fpermissive]

UPDATE:
error handling seems to have been downgraded to warnings after updating Arduino IDE fro 1.6.5 to 1.8.19
Kutte

@Twilight-Logic
Copy link
Owner Author

Have tested with the standalone IDE version 1.8.7 and 1.8.8 downloaded directly from the Arduino site and did not receive the errors or warnings. However, then tested with v1.8.8/1.8.19.0 downloaded from the Windows 10 store and discovered that these warnings do indeed appear.

Will investigate further to see whether the code can be adjusted to avoid them.

@Twilight-Logic
Copy link
Owner Author

Twilight-Logic commented Feb 12, 2019

Line 413: changed the expression NULL to character expression '\0'.
This seemed to resolve the warnings and the code compiled cleanly.

@Twilight-Logic
Copy link
Owner Author

Further warnings reported by Kutte:

Y:\USB_16GB\Voltage reference\GPIB\ar488-arduino\ar488\AR488.ino:153:0: warning: "SPE" redefined

#define SPE 0x18

In file included from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\io.h:272:0,
from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\pgmspace.h:90,
from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:28,
from sketch\AR488.ino.cpp:1:
c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\iom328p.h:294:0: note: this is the location of the previous definition
#define SPE 6
Y:\USB_16GB\Voltage reference\GPIB\ar488-arduino\ar488\AR488.ino:758:1: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]

Y:\USB_16GB\Voltage reference\GPIB\ar488-arduino\ar488\AR488.ino:758:1: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]

Y:\USB_16GB\Voltage reference\GPIB\ar488-arduino\ar488\AR488.ino:758:1: warning: invalid conversion from 'void ()()' to 'void ()(char*)' [-fpermissive]

Y:\USB_16GB\Voltage reference\GPIB\ar488-arduino\ar488\AR488.ino:758:1: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]

@Twilight-Logic
Copy link
Owner Author

In the new release of the code (0.46.01), the names of the #define variables related to GPIB commands (e.g. SPE) have been changed to avoid clashes with other Arduino modules.

@Twilight-Logic
Copy link
Owner Author

Further corrections made to the code to remove all warnings. By default it seems that this setting is now set to None, so all warnings were hidden. Compilation is now done with the Arduino IDE set to show ALL compiler warnings.

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