Noticed a couple of bugs

Post your requests and ideas on the future development of mikroPascal PRO for AVR.
Post Reply
Author
Message
vovksextra
Posts: 2
Joined: 13 Aug 2013 11:03

Noticed a couple of bugs

#1 Post by vovksextra » 13 Aug 2013 12:24

mikropascal for avr 6.0.1

I apologize for my english ..

Code: Select all

program test;
const
 hs_idle = 1;
 hs_run = 2;
{ Declarations section }
var
 state: byte;

procedure test_proc();
begin
end;

begin
  { Main program }
  case state of
  hs_idle: 
   begin
    test_proc();
   end;
  hs_run:
   begin
    test_proc();
   end
  end;
end.
15 301 "hs_idle:"is not valid identifier test.mpas

Code: Select all

program test;
const
 hs_idle = 1;
 hs_run = 2;
{ Declarations section }
var
 state: byte;

procedure test_proc();
begin
end;

begin
  { Main program }
  case state of
  hs_idle: begin
    test_proc();
   end;
  hs_run: begin
    test_proc();
   end
  end;
end.
or

Code: Select all

program test;
const
 hs_idle = 1;
 hs_run = 2;
{ Declarations section }
var
 state: byte;

procedure test_proc();
begin
end;

begin
  { Main program }
  case state of
  hs_idle: //
   begin
    test_proc();
   end;
  hs_run: //
   begin
    test_proc();
   end
  end;
end.
good ))

Code: Select all

program test;
const
   t: array [0..[b]6[/b]] of byte = (0,1,2,3);
begin

end.

Code: Select all

program test;
const
   t: array [0..[b]7[/b]] of byte = (0,1,2,3);
begin

end.
The compiler does not limit the upper limit and the compilation is without error))

jpc
Posts: 1986
Joined: 22 Apr 2005 17:40
Location: France 87

Re: Noticed a couple of bugs

#2 Post by jpc » 13 Aug 2013 19:08

try this :

Code: Select all

program test;
const
 hs_idle = 1;
 hs_run = 2;
{ Declarations section }
var
 state: byte;

procedure test_proc();
begin
end;

begin
  { Main program }
  case state of
  hs_idle :  begin
               test_proc();
             end;
  hs_run  :  begin
               test_proc();
             end;
  end;
end.
hs_idle: is considered a label

for the other issue, the compiler adds the missing elements of the array, there used to be a message reporting this but indeed, no error ( i think it is very kind of the compiler to correct our errors)
Au royaume des aveugles, les borgnes sont rois.

vovksextra
Posts: 2
Joined: 13 Aug 2013 11:03

Re: Noticed a couple of bugs

#3 Post by vovksextra » 13 Aug 2013 19:41

1. About the "case". I have quite a lot of experience with PASCAL. He started with Turbo Pascal 5.0, Delphi to 7. Nowhere is this nebilo. If developers are miropascalya do not think so, then it's something new.
2. Regarding the dimensions of the array is the same ... I caught the bug week. tucked into an array of smaller number of bytes needed me and could not understand where the problem is ....

http://voov.com.ua/atmega/tvbgone/ ->

tvbgone_source.zip ->

eucodes.mpas

.... eu_codes: array[0..num_codes-1] of ^const ir_code = (........

Is distinguished by Pascal B if I optsal dimension of an array of exactly what I want to see exactly what I have described

If the developers of the opinion, that means that something in this world is not so much))

We turn on the c))


http://voov.com.ua/

All that there has developed in the mikropascal. I will be sorry if you move on to another medium)

User avatar
marina.petrovic
Posts: 2986
Joined: 18 Apr 2013 08:11

Re: Noticed a couple of bugs

#4 Post by marina.petrovic » 14 Aug 2013 15:38

Hi,

If I understand you correctly, you expect that compiler "throws" an error when you use this code?

Code: Select all

program test;
const
   t: array [0..[b]6[/b]] of byte = (0,1,2,3);
begin

end.
You have warning in the compiler:
30 1517 Warning: Aggregate padded with zeros (3) in order to match declared size (7) LedBlinking.mpas

In your code that you posted on http://voov.com.ua/atmega/tvbgone/
error that you get "There is not enough ROM space" is because of the limited resources of the controller that you use.
If you try your code on, for example ATMEGA32, you do not get the same error.

Best regards,
Marina

Post Reply

Return to “mikroPascal PRO for AVR Wish List”