|
Post by alexfish on Aug 7, 2022 11:46:47 GMT 1
HI Peter
when compiling GCC one can not use the G++ word 'auto'
the sub (...) example
SUB IMAGE_CHECK(STRING OSMDIR$,STRING keyword$,STRING mimtype$, auto)
IF auto THEN
ELSE
END IF END SUB
IMAGE_CHECK(OSMDIR$,NULL,".png",TRUE)
BR ALEX
|
|
|
Post by Pjot on Aug 7, 2022 13:10:19 GMT 1
Hi Alex,
Indeed, the term 'auto' is in fact an original keyword in C and also in C++. It therefore cannot be used as a variable.
Same with 'break', 'extern', 'switch', 'volatile' etc.
BaCon has a mechanism to warn for using such keywords as a variable, but this check only is applied to the LOCAL/GLOBAL/DECLARE statements.
So it doesn't check this in function headers, I will see if it can be extended there as well.
BR Peter
|
|
|
Post by Pjot on Aug 7, 2022 13:51:54 GMT 1
Alex, Adding the check for function headers was not too difficult, it is in the latest beta. BR Peter
|
|
|
Post by alexfish on Aug 7, 2022 17:29:58 GMT 1
Hi pjot
downloaded & result =
Syntax error: variable 'auto' in SUB/FUNCTION statement at line 13 in file '/home/pi/Downloads/imagecheck.bac' is a C keyword or function!
Thanks + BR Alex
|
|