FYI -FWIW - trigraph error

Questions about the BASICtools and MakeItC
Post Reply
olzeke51
Posts: 414
Joined: Sat May 17, 2014 4:22 pm
Location: South Carolina

FYI -FWIW - trigraph error

Post by olzeke51 »

I found the error by the line number :: I had " Voltage = AD(??) -- hadn't decided on the channel - corrected it
'''--a single ? doesn't cause any concern/errors !!! - is that a problem??
the internet indicates it is part of the C preprocessor [from way back when] -SO you are catching R foibles !!!
'
Analyzing C:/Coridium/Basic.mbd2/Examples/Bchip_event_logger07.bas
C:/Coridium/Basic.mbd2/Examples/Bchip_event_logger07.bas:168:14: warning: trigraph ??) ignored, use -trigraphs to enable
Programming Flash 1114...
'
Having Fun , Still !!??
A trigraph is a throwback to the old days when people didn't have keyboards with lots of symbols.
eg.
??= is #
??( is [
??/ is \
??) is ]

and so on.



basicchip
Posts: 1090
Joined: Fri Oct 19, 2012 2:39 am
Location: Weeki Watchee, FL
Contact:

Re: FYI -FWIW - trigraph error

Post by basicchip »

Well we don't go randomly typing junk into the compiler to see what comes out, as the old saying garbage in garbage out

But it is something the compiler should flag, and we'll look into why it doesn't

olzeke51
Posts: 414
Joined: Sat May 17, 2014 4:22 pm
Location: South Carolina

Re: FYI -FWIW - trigraph error

Post by olzeke51 »

I got to thinking about this, and you are correct - garbage in garbage out.
the thinking part: you could check for a non-numeric, as each chip has a different amount of AD channels
(so it would be sort of hard to do a bounds check-though I'm sure 32 for AD channels would be enough)
IO(x) would be more difficult - there are at least four Ports -- so now you are upto 128 in a bounds check
'
AND now - your SELECT CASE indicates that it will treat an ASCII as a number - so a non-numeric check
could be a conditional situation.
'
testing for Junk - how far do you go ??!!!!
Just thinking out load.........

basicchip
Posts: 1090
Joined: Fri Oct 19, 2012 2:39 am
Location: Weeki Watchee, FL
Contact:

Re: FYI -FWIW - trigraph error

Post by basicchip »

The compiler is not going to check for out of bounds operations, yes some do (I believe Algol did), but C does not. Part of the reason we won't is the same compiler is run on the ARM for handling <?BASIC in web pages, and there we are quite memory constrained and the alternative of using more #ifdef's is just too hard to handle.

In cases where the (index) is a variable that can't be done until runtime, and to check that would hurt performance.

basicchip
Posts: 1090
Joined: Fri Oct 19, 2012 2:39 am
Location: Weeki Watchee, FL
Contact:

Re: FYI -FWIW - trigraph error

Post by basicchip »

? is a special character that BASICtools uses to get firmware vectors from the ARM PCB and then send them to the ARMbasic compiler.

The handling of it by the compiler was not very rigorous and that has been fixed. Posted here--

http://www.coridiumcorp.com/forum/viewt ... ?f=9&t=637

Post Reply