My OS = Win 95 I've installed MINGW32 and the GPC and have
adjusted the Autoexec.bat parameters. I can execute the command
'GPC -v' and I get the correct responce. When I try to compile a *.pas prog. I get: -
"GPC.exe: installation problem, cannot exe 'as': No such file or
directory."
I have downloaded the binutils.
(a) The './configure make' command won't work for me.
(b) I, not sure I've unziped to the right directory.
(C) Do i have to configure my autoexec.bat for binutils?
Any help …
[View More]would be greatly appreciated.
Thanks
Ger.
[View Less]
(I'm surprised a bit that nobody noticed this before.)
The complex "pow" operator gives completely bogus results with negative
exponents. Example:
[artax:pascal]% cat tst.pas
program Foo (Output);
var z: Complex;
begin
z := Cmplx (5, 0) pow (-1);
WriteLn (Re (z) : 5 : 1, Im (z) : 5 : 1)
end.
[artax:pascal]% gpc tst.pas
[artax:pascal]% ./a.out
1.0 0.0
The "Complex_Pow" function in rts/math.pas computes reciprocals as
1 / (x+iy) := (x-iy) / |x+iy|, which is a nonsense.
Here is a patch …
[View More](recycling a Maurice's idea to make it work for too big
or too small arguments).
----------------------------------------
function Complex_Pow (z: Complex; y: Integer) = r: Complex;
var a, b: Real;
begin
if y < 0 then
begin
if Abs (Re (z)) > Abs (Im (z)) then begin
a := Im (z) / Re (z);
b := Re (z) + Im (z) * a;
z := Cmplx (1 / b, -a / b)
end else begin
if Im (z) = 0 then begin
SetReturnAddress (ReturnAddress (0));
RuntimeError (706); { Executed `x pow y' when complex x is zero and y < 0 }
RestoreReturnAddress
end;
a := Re (z) / Im (z);
b := Re (z) * a + Im (z);
z := Cmplx (a / b, -1 / b);
end;
y := - y
end;
r := 1;
while y <> 0 do
begin
if Odd (y) then r := r * z;
y := y shr 1;
if y <> 0 then z := Sqr (z)
end
end;
-------------------------------------
BTW, are there any serious reasons why the complex "**" operator accepts only
_real_ exponents? As far as the RTS is concerned, it would suffice
to change "Double" to "Complex" in the declaration of "Complex_Power",
but I expect that it needs some compiler magic as well.
Emil Jerabek
[View Less]
I am able to get to the mailing list archives thru my
Web browser. I have also registered to subscribe to
this mailing list. Pls point me to any documentation
on how to use this system.
On the Web page, I can read the mail that have been
submitted using the link from the GPC documentation.
1. How do I reply to a particular mail? There is no
option to reply to the entry that I am reading.
2. I sometimes see a section in the page that says
"Reply to" with a list of previous messages. …
[View More]However,
if I click on a mail entry in the list, that particular
mail entry is displayed.
3. There is a login button at the end of the page for
registered Crystal users. Do I need to register before
I can reply to the mail in the mailing list?
Regards,
Jing Gloria
Texas Instruments
Sherman, Texas
[View Less]
Attached you find the test summaries for RC2, based on Debian's
gcc-2.95.4 compiler. For alpha it looks like the newly built gpc.pas
cannount be found. Note that all compilers are built with
srcdir != builddir.
Hi
We're having a problem when compiling while trying to use pexec. I'm
looking for suggestions/fixes if anyone has one?
The compile error is:
------------------------
[09:44:46] sdis:~/sdis >gpc sort.pas
sort.pas: In function `program_Sort':
sort.pas:11: undeclared identifier `Pexecute' (first use this function)
sort.pas:11: (Each undeclared identifier is reported only once
sort.pas:11: for each function it appears in.)
sort.pas:12: undeclared identifier `Pexecute_one' (first use this …
[View More]function)
sort.pas:12: undeclared identifier `Pexecute_search' (first use this
function)
sort.pas:12: undeclared identifier `Pexecute_verbose' (first use this
function)
[09:44:55] sdis:~/sdis >
My versions are:
------------------------
[09:23:29] root:~ >gpc -v
Reading specs from /usr/local/lib/gcc-lib/sparc-sun-solaris2.7/2.8.1/specs
gpc version 19990118, based on gcc-2.8.1
[09:23:32] root:~ >gcc -v
Reading specs from /usr/local/lib/gcc-lib/sparc-sun-solaris2.7/2.95.2/specs
gcc version 2.95.2 19991024 (release)
[09:23:39] root:~ >
Sitting on an Ultra 10 Sparc running Solaris 2.7
tam
axtlp(a)uaa.alaska.edu
[View Less]
Please see below ...
Joe.
> -----Original Message-----
> From: Frank Heckenbach [SMTP:frank@g-n-u.de]
> Sent: Monday, January 21, 2002 1:59 AM
> To: gpc(a)gnu.de
> Subject: Re: Trouble using GPC modules
>
> Nicolas Courtel wrote:
>
> > I'm trying to use the simple GPC modules mechanism, as described in the
> Doc
> > (7.1.8.1, page 85), and can't figure out how to link the provided
> example, with
> > module DemoMod3 and program ModDemo3.
> …
[View More]>
> > I'm using GPC 20011202 on Solaris-8; I tried several methods, for
> example:
> >
> > % gpc --automake moddemo3.pas
> >
> > and always get undefined linking errors:
> >
> > Setfoo /var/tmp/cc2daawp1.o
> > Getfoo /var/tmp/cc2daawp1.o
> >
> > I guess the solution is really simple, but can't find it, please help!
> >
> > Here's the example source code:
>
> Works for me. Perhaps you need to specify the `asmname's (anyway,
> this will be required in the future when GPC will support qualified
> identifiers, so you might as well do it now, and perhaps it will
> solve your problem):
>
> module DemoMod3;
>
> type
> FooType = Integer;
>
> var
> Foo : FooType;
>
> procedure SetFoo (f : FooType); asmname 'setfoo';
> procedure SetFoo (f : FooType);
>
[Joe da Silva]
OK, time for a silly question ... <g>
Why does the procedure header need to be given
twice? (Looks weird!)
[View Less]
Hi all,
I'm trying to use the simple GPC modules mechanism, as described in the Doc
(7.1.8.1, page 85), and can't figure out how to link the provided example, with
module DemoMod3 and program ModDemo3.
I'm using GPC 20011202 on Solaris-8; I tried several methods, for example:
% gpc --automake moddemo3.pas
and always get undefined linking errors:
Setfoo /var/tmp/cc2daawp1.o
Getfoo /var/tmp/cc2daawp1.o
I guess the solution is …
[View More]really simple, but can't find it, please help!
Here's the example source code:
module DemoMod3;
type
FooType = Integer;
var
Foo : FooType;
procedure SetFoo (f : FooType);
begin
Foo := f;
end; { SetFoo }
function GetFoo: Footype;
begin
GetFoo := Foo;
end; { GetFoo }
end.
program ModDemo3 (Output);
type
FooType = Integer;
procedure SetFoo (f : FooType); external;
function GetFoo: FooType; external;
begin
SetFoo (999);
Writeln (GetFoo);
end.
--
Nicolas
[View Less]
Hi all,
I'm trying to use the simple GPC modules mechanism, as described in the Doc
(7.1.8.1, page 85), and can't figure out how to link the provided example, with
module DemoMod3 and program ModDemo3.
I'm using GPC 20011202 on Solaris-8; I tried several methods, for example:
% gpc --automake moddemo3.pas
and always get undefined linking errors:
Setfoo /var/tmp/cc2daawp1.o
Getfoo /var/tmp/cc2daawp1.o
I guess the solution is …
[View More]really simple, but can't find it, please help!
Here's the example source code:
module DemoMod3;
type
FooType = Integer;
var
Foo : FooType;
procedure SetFoo (f : FooType);
begin
Foo := f;
end; { SetFoo }
function GetFoo: Footype;
begin
GetFoo := Foo;
end; { GetFoo }
end.
program ModDemo3 (Output);
type
FooType = Integer;
procedure SetFoo (f : FooType); external;
function GetFoo: FooType; external;
begin
SetFoo (999);
Writeln (GetFoo);
end.
--
Nicolas
[View Less]
Frank,
thanks for your inputs that I read in the mailing list archives.
I was hoping there is an option to allow making the names in
lowercase.
Everyone,
can somebody please send me information on how to change the GPC
naming schema so that it will generate names that are all in
lowercase? At this point I am willing to take a chance and
rebuild my GPC compiler if it will generate all lowercase names.
I have Pascal procedures/functions that are called by both Pascal
and C modules. Global …
[View More]variables are used in both C and Pascal
modules. There are close to 100 global variables and around sixty
Pascal procedures/functions shared by both C and Pascal. All
these scattered over 500 Pascal and C source files. The C modules
use all lowercase for the names. So I either convert the C files
to have first character uppercase names or add asmname in the
Pascal files. Either way, I will need to edit hundreds of files.
Regards,
Jing Gloria
Texas Instruments
Sherman, TX
[View Less]
Hello, all
I'm working with some large arrays (2^27 elements), and am about to run
into memory limitations. Currently I'm using a bytecard for each
element, but in expanding my program's capabilities, I want to add a
second array of cardinal. This second cardinal needs to have a range
larger than 2^16 (65535), but I don't have enough memory for a 2^32
cardinal. Sounds like 2^24 cardinals would be appropriate...
I looked into the range-specified integers in the manual. It says:
>>&…
[View More]gt;
8.2.3.3 Integer Types with Specified Size
In some situations you will need an integer type of a well-defined size.
For this purpose, GNU Pascal provides three families of signed and
unsinged integer types. The type
Integer (42)
is guaranteed to have a precision of 42 bits. In a realistic context,
you will most often give a power of two as the number of bits, and the
machine you will need it on will support variables of that size. If this
is the case, the specified precision will simultaneously be the amount
of storage needed for variables of this type.
<<<
So perhaps the 24-bit cardinal would work fine.
My questions:
1) will the compiler really allocate only 24 bits, or will it align the
array elements along 32-bit boundaries?
2) If the compiler does indeed make true 24-bit-aligned cardinals, how
much speed will I lose in memory access?
If this is an unexplored issued, please let me know, in which case I'll
attempt it and report back on how it worked.
regards,
Toby
Soil Scientist, Iowa State University
[View Less]