Page 3 of 4
Re: [NXC] Memory Manager
Posted: 17 Mar 2011, 22:35
by muntoo
The "bug" that I fixed (in my last post, which still requires testing) was in my code in task main(). (I fixed it.)
afanofosc wrote:
// Report NXC Bug. Can't use "MM_ID ptr = myvar;"
Oh, sorry, I should have deleted that line; my code comments [if any] are a bit misleading at the moment. That line was from before when I was getting random compiler errors on that line; it was actually another bug in the compiler [below].
The bug in the compiler: I can't use any more #includes without causing a compiler error.
Re: [NXC] Memory Manager
Posted: 18 Mar 2011, 00:55
by afanofosc
What I need is a zip containing exactly the files that cause the error - not modified so that the error no longer happens. And preferably simplified to as little content as possible to still have the error occur. And the F12 error listing. So far I have not been able to understand your description of the problem. Are you saying that if I #include a file that #includes 4 or 5 other files - regardless of the content - it will cause a compiler error? Or is it only if one of the include files ends with a block comment?
John Hansen
Re: [NXC] Memory Manager
Posted: 18 Mar 2011, 02:25
by muntoo
EDIT: Also, could someone tell me the output on the NXT's screen of the "v04_works" version? Thanks.
Attached are the "working" and "error" versions.
The "MM-Demo.nbc" is the F12 Code Listing.
(BTW, how do you produce "Code Listing" via command line? -sm- -ER=5 -EF -v=128 -Z2 -L="..." produces a thousand #line xxx "...")
----
The working version has this in "MM-Demo.nxc":
The error version has this in "MM-Demo.nxc" instead:
Those are the only differences.
-----
Attachments:
Re: [NXC] Memory Manager
Posted: 18 Mar 2011, 07:36
by afanofosc
All of your files that end with
need to be changed so that they end with either
or
The tokenizer used by the Preprocessor is not returning a token for #endif when there are no more bytes in the file following the "f" Even if you had a space after #endif it would work but not (currently) with the file ending with "f".
Didn't you report some kind of problem also when a file ended with a block comment? Probably the same kind of problem (i.e., no bytes in the file following the "/" at the end of the block comment). Use an editor that adds 0D 0A to the end of your files (like BricxCC does) and you won't have this problem.
John Hansen
Re: [NXC] Memory Manager
Posted: 19 Mar 2011, 21:44
by muntoo
afanofosc wrote:Didn't you report some kind of problem also when a file ended with a block comment? Probably the same kind of problem (i.e., no bytes in the file following the "/" at the end of the block comment). Use an editor that adds 0D 0A to the end of your files (like BricxCC does) and you won't have this problem.
Yeah, it works now.
The block comment problem was the same; the file ended with "/" with no CRLF or space.)
Re: [NXC] Memory Manager
Posted: 19 Mar 2011, 21:47
by muntoo
New Test File
Please test the .rxe, and tell me what the output is. (Or post a NXT screenshot/screencapture.)
Thanks.
- v0_4.zip
- (36.94 KiB) Downloaded 286 times
Re: [NXC] Memory Manager
Posted: 19 Mar 2011, 23:22
by timpattinson
As far as I can tell, it still doesn't work
-Tim
Re: [NXC] Memory Manager
Posted: 20 Mar 2011, 00:40
by muntoo
New Test File
Please test the .rxe, and tell me what the output is. (Or post a NXT screenshot/screencapture.)
Thanks.
-----
This program will act differently. I know it!
- v0_4.zip
- (36.95 KiB) Downloaded 284 times
Re: [NXC] Memory Manager
Posted: 20 Mar 2011, 02:29
by timpattinson
It works now
- screenshot.gif (1.43 KiB) Viewed 7619 times
-Tim
Re: [NXC] Memory Manager
Posted: 20 Mar 2011, 20:41
by muntoo