hi
minwidth for strings in writeln is broken:
program hello; begin writeln('hello':30, ' ':30, 'world'); end.
The output should be 25 spaces in front of hello and 30 spaces between hello and world.
Russ
Russell Whitaker wrote:
minwidth for strings in writeln is broken:
program hello; begin writeln('hello':30, ' ':30, 'world'); end.
The output should be 25 spaces in front of hello and 30 spaces between hello and world.
That's what I get!?
Did you compile with any special options?
Can someone else reproduce the problem?
Frank
Frank Heckenbach wrote:
Russell Whitaker wrote:
minwidth for strings in writeln is broken:
program hello; begin writeln('hello':30, ' ':30, 'world'); end.
The output should be 25 spaces in front of hello and 30 spaces between hello and world.
That's what I get!?
Did you compile with any special options?
Can someone else reproduce the problem?
Following is my result:
[1] c:\p\junk>a 12345678901234567890123456789012345678901234567890123456789012345 Hello world
[1] c:\p\junk>gpc --version gpc.exe 20021128, based on gcc-3.2.1 ....
[1] c:\p\junk>type test05.p PROGRAM test05(input, output);
VAR i : integer;
BEGIN FOR i := 1 TO 65 DO write(chr(ord('0') + (i MOD 10))); writeln; writeln('Hello' : 30, ' ' : 30, 'world'); END.
Frank Heckenbach wrote:
Russell Whitaker wrote:
minwidth for strings in writeln is broken:
program hello; begin writeln('hello':30, ' ':30, 'world'); end.
The output should be 25 spaces in front of hello and 30 spaces between hello and world.
That's what I get!?
Did you compile with any special options?
Can someone else reproduce the problem?
No, I also get the correct output.
Attached is a diff to add to your p/diffs
Thanks for the diff. I built a compiler with the gcc-3.2.2 back-end; it gave me the same testsuite results as gcc-3.2.1. Unlike gcc-3.2.1, gcc-3.2.2 bootstraps without any patches on Mac OS X. Still, for correct results, I apply the "trampoline" and "longjump" patches.
Regards,
Adriaan van Os
On Tue, 11 Feb 2003, Frank Heckenbach wrote:
Russell Whitaker wrote:
minwidth for strings in writeln is broken:
program hello; begin writeln('hello':30, ' ':30, 'world'); end.
The output should be 25 spaces in front of hello and 30 spaces between hello and world.
That's what I get!?
Used gcc-3.2.2 so recompiled gpc with gcc-2.95.3
It now works!
Who would like to tell the gcc folks there's a bug in gcc-3.2.2? And how about making a 3.2.3 while we're waiting for 3.3?
Russ
Russell Whitaker wrote:
On Tue, 11 Feb 2003, Frank Heckenbach wrote:
Russell Whitaker wrote:
minwidth for strings in writeln is broken:
program hello; begin writeln('hello':30, ' ':30, 'world'); end.
The output should be 25 spaces in front of hello and 30 spaces between hello and world.
That's what I get!?
Used gcc-3.2.2 so recompiled gpc with gcc-2.95.3
I now tried with gcc-3.2.2, and it also works.
What did you get actually, did you use any options, etc. ...?
Frank
On Fri, 21 Feb 2003, Frank Heckenbach wrote:
Russell Whitaker wrote:
On Tue, 11 Feb 2003, Frank Heckenbach wrote:
Russell Whitaker wrote:
minwidth for strings in writeln is broken:
program hello; begin writeln('hello':30, ' ':30, 'world'); end.
The output should be 25 spaces in front of hello and 30 spaces between hello and world.
That's what I get!?
Used gcc-3.2.2 so recompiled gpc with gcc-2.95.3
I now tried with gcc-3.2.2, and it also works.
What did you get actually, did you use any options, etc. ...?
How to get egg on one's face:
Start with this line of code written 3 years ago:
writeln( LST, px[3], Title:35 + length(Title)/2, '':35 - length(Title)/2, 'line ', index:4 );
Compiled and ran ok. Recompliled with every new gpc release until this last one, which also used a new gcc. So to make finding out why, copied hello.pas to nhello.pas:
cp hello.pas nhello.pas
Edited nhello.pas with my trusty editor to the code above, and compiled it and ran it:
gpc -o hello hello.pas
By golly, it doesn't work! So recompiled gpc with gcc-2.95.3 and:
gpc -o hello nhello.pas
By golly, now it works!
Making a long story short, the original problem was integer / integer is a real and minwidth no longer accepts a real. Fixed problem: changed "/" to "div", and went back to using latest alpha with gcc-3.2.2
Russ