ooc-compiler Mailing List for Optimizing Oberon-2 Compiler (Page 9)
Brought to you by:
mva
You can subscribe to this list here.
| 2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
(34) |
Aug
(19) |
Sep
(33) |
Oct
(14) |
Nov
(4) |
Dec
(4) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2001 |
Jan
(6) |
Feb
(11) |
Mar
(8) |
Apr
(1) |
May
(24) |
Jun
(12) |
Jul
(13) |
Aug
(16) |
Sep
(8) |
Oct
(6) |
Nov
|
Dec
(5) |
| 2002 |
Jan
|
Feb
(14) |
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
(3) |
Aug
(8) |
Sep
|
Oct
(3) |
Nov
|
Dec
(6) |
| 2003 |
Jan
(6) |
Feb
(4) |
Mar
(1) |
Apr
(1) |
May
(11) |
Jun
|
Jul
(1) |
Aug
(1) |
Sep
(3) |
Oct
(12) |
Nov
(22) |
Dec
(3) |
| 2004 |
Jan
(11) |
Feb
(16) |
Mar
(8) |
Apr
|
May
(35) |
Jun
(3) |
Jul
(14) |
Aug
(3) |
Sep
(7) |
Oct
(4) |
Nov
(30) |
Dec
(3) |
| 2005 |
Jan
(7) |
Feb
(16) |
Mar
(2) |
Apr
|
May
(10) |
Jun
(2) |
Jul
(4) |
Aug
(5) |
Sep
(4) |
Oct
(11) |
Nov
(1) |
Dec
(14) |
| 2006 |
Jan
(15) |
Feb
(6) |
Mar
(3) |
Apr
|
May
(1) |
Jun
(7) |
Jul
(11) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2007 |
Jan
|
Feb
(5) |
Mar
(6) |
Apr
|
May
|
Jun
(11) |
Jul
(2) |
Aug
|
Sep
(9) |
Oct
(4) |
Nov
(2) |
Dec
|
| 2008 |
Jan
(5) |
Feb
(4) |
Mar
(5) |
Apr
|
May
(11) |
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(4) |
Dec
(7) |
| 2009 |
Jan
(8) |
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(3) |
Sep
(6) |
Oct
(6) |
Nov
|
Dec
|
| 2010 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
(1) |
Jun
(2) |
Jul
(28) |
Aug
(18) |
Sep
|
Oct
(9) |
Nov
|
Dec
|
| 2011 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
(16) |
Aug
(18) |
Sep
(1) |
Oct
|
Nov
(1) |
Dec
(1) |
| 2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
| 2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(4) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(2) |
| 2016 |
Jan
(4) |
Feb
(1) |
Mar
(3) |
Apr
(1) |
May
(1) |
Jun
|
Jul
(2) |
Aug
(4) |
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Patrick F. <fi...@ya...> - 2007-03-18 22:55:07
|
Stewart, Thank you very much for the code. This does almost completely what I need. Have a great weekend, Fitz --- Stewart Greenhill <sgr...@us...> wrote: > Hi Fitz, > > OO2C has a mechanism for declaring functions that do > "raw" calls to C > code. These calls don't assume that there is a "C" > declaration for the > function - they just emit the call code and let the > C compiler take care > of the rest. This is used in modules like RealMath > to do fast calls to > math functions. It works via procedure renaming. > When the compiler sees > a particular type of name, it just emits the > procedure alias when it > calls the function. For example, in RealMath we have > this: > > PROCEDURE ["(float)sin"] sin* (x: REAL): REAL; > > So when you call RealMath.sin it just emits > "(float)sin" allowing the > type cast to be done at call-time, rather than in a > separate function. > > So here's what you need to do - its a bit of a hack, > but works. You can > use this mechanism to get the values of constants > and variables, but you > need to remove the actual parameters that the > compiler passes to the > function. Add the following to > /usr/local/lib/oo2c/src/__oo2c.h > > #define NOPARAMS() > > Now you can use the "raw calls" mechanism to get the > values that you want. > > The variable _mid is the descriptor of the current > module, so you can > get the module name, or the descriptor itself like > this: > > PROCEDURE ["(_mid.name)NOPARAMS"] ModName* () : > RT0.Name; > PROCEDURE ["(&_mid)NOPARAMS"] Module* () : > RT0.Module; > > The following gives you the source file name, > function name and line > number. Of course, these are for the "C" source code > emitted by OOC, but > you might be able to maniuplate the values to give > you what you want > (eg. to strip OOC's function name decorations giving > you the Oberon-2 > function name). I don't know a good way to get the > Oberon-2 source-code > context without actually halting the program (eg. > ASSERT, or run-time > exception). > > PROCEDURE ["(__FILE__)NOPARAMS"] File* () : > RT0.Name; > PROCEDURE ["(__FUNCTION__)NOPARAMS"] Func* () : > RT0.Name; > PROCEDURE ["(__LINE__)NOPARAMS"] Line* () : LONGINT; > > Attached is some code for you to try. Hope this > helps. > > Cheers, > Stewart > > Fitzpatrick, Patrick-p98785 wrote: > > Hi gang, > > > > Is there some way for me to get the Module and > Procedure name into a > > constant/string like this: > > > > String Module = __MODULE__; > > > > So I can Out.String( "You have entered Module: " > ); Out.String( Module > > ); Out.Ln; > > > > TIA. > > > > Have a great day, > > Fitz > > Rational Support > > (480) 441-1805 > > > > > > > >> "This email message is for the sole use of the > intended > >>recipient(s) and may contain GDC4S confidential or > privileged > >>information. Any unauthorized review, use, > disclosure or distribution > >>is prohibited. If you are not an intended > recipient, please contact > >>the sender by reply email and destroy all copies > of the original > >>message." > >> > >> > > > > > > > > > ------------------------------------------------------------------------ > > > > > ------------------------------------------------------------------------- > > Take Surveys. Earn Cash. Influence the Future of > IT > > Join SourceForge.net's Techsay panel and you'll > get the chance to share your > > opinions on IT & business topics through brief > surveys-and earn cash > > > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > > > > > > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > ooc-compiler mailing list > > ooc...@li... > > > https://lists.sourceforge.net/lists/listinfo/ooc-compiler > ____________________________________________________________________________________ TV dinner still cooling? Check out "Tonight's Picks" on Yahoo! TV. http://tv.yahoo.com/ |
|
From: Stewart G. <sgr...@us...> - 2007-03-16 03:29:41
|
Hi Fitz, OO2C has a mechanism for declaring functions that do "raw" calls to C code. These calls don't assume that there is a "C" declaration for the function - they just emit the call code and let the C compiler take care of the rest. This is used in modules like RealMath to do fast calls to math functions. It works via procedure renaming. When the compiler sees a particular type of name, it just emits the procedure alias when it calls the function. For example, in RealMath we have this: PROCEDURE ["(float)sin"] sin* (x: REAL): REAL; So when you call RealMath.sin it just emits "(float)sin" allowing the type cast to be done at call-time, rather than in a separate function. So here's what you need to do - its a bit of a hack, but works. You can use this mechanism to get the values of constants and variables, but you need to remove the actual parameters that the compiler passes to the function. Add the following to /usr/local/lib/oo2c/src/__oo2c.h #define NOPARAMS() Now you can use the "raw calls" mechanism to get the values that you want. The variable _mid is the descriptor of the current module, so you can get the module name, or the descriptor itself like this: PROCEDURE ["(_mid.name)NOPARAMS"] ModName* () : RT0.Name; PROCEDURE ["(&_mid)NOPARAMS"] Module* () : RT0.Module; The following gives you the source file name, function name and line number. Of course, these are for the "C" source code emitted by OOC, but you might be able to maniuplate the values to give you what you want (eg. to strip OOC's function name decorations giving you the Oberon-2 function name). I don't know a good way to get the Oberon-2 source-code context without actually halting the program (eg. ASSERT, or run-time exception). PROCEDURE ["(__FILE__)NOPARAMS"] File* () : RT0.Name; PROCEDURE ["(__FUNCTION__)NOPARAMS"] Func* () : RT0.Name; PROCEDURE ["(__LINE__)NOPARAMS"] Line* () : LONGINT; Attached is some code for you to try. Hope this helps. Cheers, Stewart Fitzpatrick, Patrick-p98785 wrote: > Hi gang, > > Is there some way for me to get the Module and Procedure name into a > constant/string like this: > > String Module = __MODULE__; > > So I can Out.String( "You have entered Module: " ); Out.String( Module > ); Out.Ln; > > TIA. > > Have a great day, > Fitz > Rational Support > (480) 441-1805 > > > >> "This email message is for the sole use of the intended >>recipient(s) and may contain GDC4S confidential or privileged >>information. Any unauthorized review, use, disclosure or distribution >>is prohibited. If you are not an intended recipient, please contact >>the sender by reply email and destroy all copies of the original >>message." >> >> > > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > > > ------------------------------------------------------------------------ > > _______________________________________________ > ooc-compiler mailing list > ooc...@li... > https://lists.sourceforge.net/lists/listinfo/ooc-compiler |
|
From: Fitzpatrick, Patrick-p. <Pat...@gd...> - 2007-03-15 19:21:42
|
Hi gang, Is there some way for me to get the Module and Procedure name into a constant/string like this: String Module =3D __MODULE__; So I can Out.String( "You have entered Module: " ); Out.String( Module ); Out.Ln; TIA. Have a great day, Fitz Rational Support (480) 441-1805 > "This email message is for the sole use of the intended > recipient(s) and may contain GDC4S confidential or privileged > information. Any unauthorized review, use, disclosure or distribution > is prohibited. If you are not an intended recipient, please contact > the sender by reply email and destroy all copies of the original > message." >=20 >=20 |
|
From: Treutwein B. <Ber...@Ve...> - 2007-03-02 11:52:54
|
Hi Stewart, thanks, (re)moving /usr/local/lib/oo2c before doing "make install" solved the problem. regards -- Bernhard Treutwein, IuK, Ref. III A 3 Bernhard.Treutwein(at)verwaltung uni-muenchen de > -----Original Message----- > From: ooc...@li...=20 > [mailto:ooc...@li...] On Behalf=20 > Of Stewart Greenhill > Sent: Friday, March 02, 2007 12:20 PM > To: Treutwein Bernhard > Cc: ooc...@li... > Subject: Re: [ooc-compiler] make install fails under cygwin >=20 >=20 > Hi Bernhard, >=20 > Try removing the directory /usr/local/lib/oo2c before doing=20 > "make install". >=20 > It looks like the file is somehow locked under cygwin. Cygwin's file=20 > semantics are not exactly the same as unix. For example, you can't=20 > rename open files so perhaps you can't rewrite them either. >=20 > Its possible that oo2c may already have that file open if the=20 > instance=20 > doing the installation has found the configuration of a pre-installed=20 > instance. If this is the case it might be a bug that does not show up=20 > under unix. I'm not too sure about that... >=20 > Cheers, > Stewart >=20 > Treutwein Bernhard wrote: > > Hello everybody, > >=20 > > under cygwin make install fails when trying to replace=20 > > /usr/local/lib/oo2c/pkginfo/liboo2c.xml > >=20 > > last lines of the installation are: > >=20 > > [...] > > /usr/bin/install -c -m 644 lib/sym/liboo2c.Doc=20 > /usr/local/lib/oo2c/sym=20 > > /usr/bin/install -c -m 644 lib/sym/liboo2c.Sym=20 > /usr/local/lib/oo2c/sym=20 > > /usr/bin/install -c -m 644 lib/sym/libxml.Doc=20 > /usr/local/lib/oo2c/sym=20 > > /usr/bin/install -c -m 644 lib/sym/libxml.Sym=20 > /usr/local/lib/oo2c/sym=20 > > ## Exception: IO.AccessDenied ## Permission denied:=20 > > /usr/local/lib/oo2c/pkginfo/liboo2c.xml > >=20 > > make: *** [install] Error 126 > >=20 > > I guess it is due to different rename/overwrite semantics=20 > between unix > > and windows. > >=20 > > Any ideas/suggestions how to cure that? > >=20 > > regards > > -- > > Bernhard Treutwein > >=20 > >=20 > ---------------------------------------------------------------------- > > --- > > Take Surveys. Earn Cash. Influence the Future of IT > > Join SourceForge.net's Techsay panel and you'll get the=20 > chance to share your > > opinions on IT & business topics through brief surveys-and earn cash > >=20 > http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge &CID=3DDEVDEV > _______________________________________________ > ooc-compiler mailing list > ooc...@li... > https://lists.sourceforge.net/lists/listinfo/ooc-compiler >=20 -------------------------------------------------------------------------= Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share = your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3D= DEVDEV _______________________________________________ ooc-compiler mailing list ooc...@li... https://lists.sourceforge.net/lists/listinfo/ooc-compiler |
|
From: Stewart G. <sgr...@us...> - 2007-03-02 11:20:39
|
Hi Bernhard, Try removing the directory /usr/local/lib/oo2c before doing "make install". It looks like the file is somehow locked under cygwin. Cygwin's file semantics are not exactly the same as unix. For example, you can't rename open files so perhaps you can't rewrite them either. Its possible that oo2c may already have that file open if the instance doing the installation has found the configuration of a pre-installed instance. If this is the case it might be a bug that does not show up under unix. I'm not too sure about that... Cheers, Stewart Treutwein Bernhard wrote: > Hello everybody, > > under cygwin make install fails when trying to replace > /usr/local/lib/oo2c/pkginfo/liboo2c.xml > > last lines of the installation are: > > [...] > /usr/bin/install -c -m 644 lib/sym/liboo2c.Doc /usr/local/lib/oo2c/sym > /usr/bin/install -c -m 644 lib/sym/liboo2c.Sym /usr/local/lib/oo2c/sym > /usr/bin/install -c -m 644 lib/sym/libxml.Doc /usr/local/lib/oo2c/sym > /usr/bin/install -c -m 644 lib/sym/libxml.Sym /usr/local/lib/oo2c/sym > ## Exception: IO.AccessDenied > ## Permission denied: /usr/local/lib/oo2c/pkginfo/liboo2c.xml > > make: *** [install] Error 126 > > I guess it is due to different rename/overwrite semantics between unix > and windows. > > Any ideas/suggestions how to cure that? > > regards > -- > Bernhard Treutwein > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > ooc-compiler mailing list > ooc...@li... > https://lists.sourceforge.net/lists/listinfo/ooc-compiler > |
|
From: Treutwein B. <Ber...@Ve...> - 2007-03-02 10:45:16
|
Hello everybody, under cygwin make install fails when trying to replace /usr/local/lib/oo2c/pkginfo/liboo2c.xml last lines of the installation are: [...] /usr/bin/install -c -m 644 lib/sym/liboo2c.Doc /usr/local/lib/oo2c/sym /usr/bin/install -c -m 644 lib/sym/liboo2c.Sym /usr/local/lib/oo2c/sym /usr/bin/install -c -m 644 lib/sym/libxml.Doc /usr/local/lib/oo2c/sym /usr/bin/install -c -m 644 lib/sym/libxml.Sym /usr/local/lib/oo2c/sym ## Exception: IO.AccessDenied ## Permission denied: /usr/local/lib/oo2c/pkginfo/liboo2c.xml make: *** [install] Error 126 I guess it is due to different rename/overwrite semantics between unix=20 and windows. Any ideas/suggestions how to cure that? regards -- Bernhard Treutwein |
|
From: Michael G. <mg...@co...> - 2007-02-26 23:44:40
|
A function equivalent to the Real.Ten() can be approximated with the
RealMath.power
function whose interface is shown below.
Mathematically, the Real.Ten(x) gives 1*10^(x) so the
RealMath.power(10.0, x) would
also give 1*10^(x).
PROCEDURE power*(base, exponent: REAL): REAL;
(* Returns the value of the number base raised to the power exponent
for base > 0 *)
Hope this helps,
Michael G.
|
|
From: Norayr C. <gn...@gm...> - 2007-02-26 14:52:09
|
Hello I am using oo2c 1.5.9 Could you please point me to the library function identical to Reals.Ten in Native Oberon ? I cannot find such a function in reference manual, may be it is not implemented? Thanks |
|
From: August K. <fus...@co...> - 2007-02-20 20:53:12
|
Michael van Acken skrev: > On 20/02/07, *August Karlstrom* <fus...@co... > <mailto:fus...@co...>> wrote: [...] > Standard Oberon-2 does not support closures but even if it did I think > the result should be "1". > > > Correct on both counts. gcc does some tricky things to get local > functions > to work via pointers, so the above code does not crash outright. > > And the result should be "1". > > Comments? [...] > One fix would be to assume that any call to any procedure might change > any local > variable if the address of a nested procedure is taken somewhere. The most obvious solution, I guess, is to just follow the Oberon-2 standard and disallow assignment of local procedures. August |
|
From: Michael v. A. <mic...@gm...> - 2007-02-20 19:20:07
|
On 20/02/07, August Karlstrom <fus...@co...> wrote: > > Hi, > > With OO2C 2.1.11 the following module compiles and prints "0". > > MODULE Test; > > IMPORT Out; > > PROCEDURE Q(p: PROCEDURE); BEGIN p END Q; > > PROCEDURE P; > VAR n: LONGINT; > PROCEDURE Inner; BEGIN INC(n) END Inner; > BEGIN > n := 0; > Q(Inner); > Out.Int(n, 0); Out.Ln > END P; > > BEGIN > P > END Test. > > Standard Oberon-2 does not support closures but even if it did I think > the result should be "1". Correct on both counts. gcc does some tricky things to get local functions to work via pointers, so the above code does not crash outright. And the result should be "1". Comments? The intermediate code representation is rather optimistic about the possbility of changes to local variables, and changes via a trampoline external to the procedure itself are not factored in. The assumption is that Q, which is not local to P and also does not get a pointer to "n", cannot possibly change the value of "n". This is wrong in this case. One fix would be to assume that any call to any procedure might change any local variable if the address of a nested procedure is taken somewhere. -- mva |
|
From: August K. <fus...@co...> - 2007-02-20 18:52:41
|
Hi,
With OO2C 2.1.11 the following module compiles and prints "0".
MODULE Test;
IMPORT Out;
PROCEDURE Q(p: PROCEDURE); BEGIN p END Q;
PROCEDURE P;
VAR n: LONGINT;
PROCEDURE Inner; BEGIN INC(n) END Inner;
BEGIN
n := 0;
Q(Inner);
Out.Int(n, 0); Out.Ln
END P;
BEGIN
P
END Test.
Standard Oberon-2 does not support closures but even if it did I think
the result should be "1".
Comments?
August
|
|
From: August K. <aug...@ya...> - 2006-07-28 13:21:10
|
--- Michael van Acken <mic...@gm...> skrev: > On 28/07/06, August Karlstrom <aug...@ya...> wrote: > > > If I use a variable of a primitive type before it's > > defined, I get a warning from oo2c. That is not the > > case with array variables. Why is that? > > Correct. The one was easy to do, the other not. Both arrays and records > are written piecemeal, and parts can therefore be defined or undefined. > So I decided to skip the warnings for them altogether. OK. Maybe a warning could be issued if such a variable is completely undefined. August |
|
From: Michael v. A. <mic...@gm...> - 2006-07-28 08:29:53
|
On 28/07/06, August Karlstrom <aug...@ya...> wrote: > > Hi, > > If I use a variable of a primitive type before it's > defined, I get a warning from oo2c. That is not the > case with array variables. Why is that? Correct. The one was easy to do, the other not. Both arrays and records are written piecemeal, and parts can therefore be defined or undefined. So I decided to skip the warnings for them altogether. -- mva Example: > > [august src]$ cat Test.Mod > MODULE Test; > > IMPORT Out; > > PROCEDURE P*; > VAR s: ARRAY 10 OF CHAR; > k: LONGINT; > BEGIN > Out.String(s); Out.Ln; > Out.Int(k, 1); Out.Ln; > END P; > > END Test. > [august src]$ oo2c -M -r .. Test.Mod > /home/august/prog/oberon/test/src/Test.Mod:10:15: > Warning: Undefined variable > > > Regards, > > August > > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > opinions on IT & business topics through brief surveys -- and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > ooc-compiler mailing list > ooc...@li... > https://lists.sourceforge.net/lists/listinfo/ooc-compiler > |
|
From: August K. <aug...@ya...> - 2006-07-28 07:53:44
|
Hi,
If I use a variable of a primitive type before it's
defined, I get a warning from oo2c. That is not the
case with array variables. Why is that?
Example:
[august src]$ cat Test.Mod
MODULE Test;
IMPORT Out;
PROCEDURE P*;
VAR s: ARRAY 10 OF CHAR;
k: LONGINT;
BEGIN
Out.String(s); Out.Ln;
Out.Int(k, 1); Out.Ln;
END P;
END Test.
[august src]$ oo2c -M -r .. Test.Mod
/home/august/prog/oberon/test/src/Test.Mod:10:15:
Warning: Undefined variable
Regards,
August
|
|
From: Stewart G. <sgr...@us...> - 2006-07-17 02:21:24
|
Hi Klass, Sorry for the delay. I just tried rebuilding ooc2 on my Mac and it seems to work fine under gcc 4.0. Can you please try these commands, and let me know what you get: gcc-4.0 --version gcc-3.3 --version uname -a Is this an Intel Mac, or PPC Mac? Come to think of it, has anyone tried building oo2c on an Intel Mac? Which system functions did you want to use? Most of the basic system functionality (files, directories, sockets, I/O, time/date, etc) is wrapped by the OOC standard libraries. I did a rough translation of the Carbon API, which is available from the VisualOberon project page: http://sourceforge.net/projects/visualoberon VisualOberon runs reasonably well on the Mac, and provides GUI framework that is cross-platform. With some tinkering it can be made to look close to the native (Aqua) theme. Cheers, Stewart Klaas Punt wrote: >> Hi, >> I received no reply, but am glad to tell you that >> the installationproblem has been solved. >> >> I changed the standard GCC that is used from 4.0 >> to 3.3 (using gcc_select). The problem with nested >> code disappeared, and yes after some time there >> was this "Hello" I wished for. >> >> Now of course I need to go further. I have lost of >> Oberon code, but for my Mac I have no idea how to >> use the system interfaces from oo2c. > > >> >> I still need to do more reading/searches, but in >> the meantime I would be very much helped if someone >> could let me have some working (example) code. >> >> Things I would like to do is Open a Window, display >> a list in the window etc. >> Any pointers are very much appreciated. >> kind regards, >> Klaas Punt. >> >> >> >> >>> >>> LS, >>> I am trying to install oo2c on a newly build 10.4 Mac OS X. >>> >>> As before I get nowhere. I really need someone to hold my hand >>> and send me in the right direction. >> >> >> >>> >>> I downloaded the latest oo2c, selected the 32 bit (I have a G5, >>> but decided to keep it simple(!), and tries to follow the >>> instructions. >>> >>> - configure showed no errors >>> >>> - make told me there were problems. >>> >>> Now I installed gc and libtool as directed, but now I am really >>> tired and short of ideas. As I have given up a number of times >>> before, I really would like to succeed with this install. >>> >> > > > > ------------------------------------------------------------------------ > > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > > > ------------------------------------------------------------------------ > > _______________________________________________ > ooc-compiler mailing list > ooc...@li... > https://lists.sourceforge.net/lists/listinfo/ooc-compiler |
|
From: Klaas P. <kp...@ma...> - 2006-07-16 18:31:28
|
> Hi, > I received no reply, but am glad to tell you that > the installationproblem has been solved. > > I changed the standard GCC that is used from 4.0 > to 3.3 (using gcc_select). The problem with nested > code disappeared, and yes after some time there > was this "Hello" I wished for. > > Now of course I need to go further. I have lost of > Oberon code, but for my Mac I have no idea how to > use the system interfaces from oo2c. > > I still need to do more reading/searches, but in > the meantime I would be very much helped if someone > could let me have some working (example) code. > > Things I would like to do is Open a Window, display > a list in the window etc. > Any pointers are very much appreciated. > kind regards, > Klaas Punt. > > > > >> >> LS, >> I am trying to install oo2c on a newly build 10.4 Mac OS X. >> >> As before I get nowhere. I really need someone to hold my hand >> and send me in the right direction. > > >> >> I downloaded the latest oo2c, selected the 32 bit (I have a G5, >> but decided to keep it simple(!), and tries to follow the >> instructions. >> >> - configure showed no errors >> >> - make told me there were problems. >> >> Now I installed gc and libtool as directed, but now I am really >> tired and short of ideas. As I have given up a number of times >> before, I really would like to succeed with this install. >> > |
|
From: Klaas P. <kp...@ma...> - 2006-07-14 16:58:33
|
LS, I am trying to install oo2c on a newly build 10.4 Mac OS X. As before I get nowhere. I really need someone to hold my hand and send me in the right direction. I downloaded the latest oo2c, selected the 32 bit (I have a G5, but decided to keep it simple(!), and tries to follow the instructions. - configure showed no errors - make told me there were problems. Now I installed gc and libtool as directed, but now I am really tired and short of ideas. As I have given up a number of times before, I really would like to succeed with this install. So, please help me. By the way, I am an experienced mainframe Syspro but still can't get my head around the Unix stuff it seems. The partial output from make: klaas-punts-power-mac-g5:~/Desktop/OOC kpunt$ cd oo2c_32-2.1.10 klaas-punts-power-mac-g5:~/Desktop/OOC/oo2c_32-2.1.10 kpunt$ make make -C stage0 -f Makefile.ext setup-src oo2c test -h src || (rm -Rf src lib/src; cp -R ../src .; cp -R ../lib/src lib) gcc -g -O2 -traditional-cpp -no-cpp-precomp -Ilib/src -I./obj -I./lib/ obj -c ./lib/obj/ADT/ArrayList.c -o ./lib/obj/ADT/ArrayList.o ./lib/obj/ADT/ArrayList.c: In function 'ADT_ArrayList__ArrayListDesc_Remove': ./lib/obj/ADT/ArrayList.c:313: error: stray '##' in program ./lib/obj/ADT/ArrayList.c:313: error: '_TBP_' undeclared (first use in this function) ./lib/obj/ADT/ArrayList.c:313: error: (Each undeclared identifier is reported only once ./lib/obj/ADT/ArrayList.c:313: error: for each function it appears in.) ./lib/obj/ADT/ArrayList.c:313: error: parse error before 'ADT_ArrayList__ArrayListDesc_RemoveRange' ./lib/obj/ADT/ArrayList.c:313: error: stray '##' in program ./lib/obj/ADT/ArrayList.c:313: error: '_TBN_' undeclared (first use in this function) ./lib/obj/ADT/ArrayList.c:313: error: parse error before 'ADT_ArrayList__ArrayListDesc_RemoveRange' ./lib/obj/ADT/ArrayList.c: In function 'ADT_ArrayList__ArrayListDesc_Contains': ./lib/obj/ADT/ArrayList.c:359: error: stray '##' in program ./lib/obj/ADT/ArrayList.c:359: error: '_TBP_' undeclared (first use in this function) ./lib/obj/ADT/ArrayList.c:359: error: parse error before 'Object__ObjectDesc_Equals' ./lib/obj/ADT/ArrayList.c:359: error: stray '##' in program ./lib/obj/ADT/ArrayList.c:359: error: '_TBN_' undeclared (first use in this function) ./lib/obj/ADT/ArrayList.c:359: error: parse error before 'Object__ObjectDesc_Equals' ./lib/obj/ADT/ArrayList.c: In function 'ADT_ArrayList__ArrayListDesc_IndexOf': ./lib/obj/ADT/ArrayList.c:388: error: stray '##' in program ./lib/obj/ADT/ArrayList.c:388: error: '_TBP_' undeclared (first use in this function) ./ =============== Well may be someone can tell me where to go from here. regards, Klaas Punt |
|
From: Stewart G. <sgr...@ii...> - 2006-07-11 01:28:49
|
Hi Bernhard, I think this issue is related to how gcc interprets path names. I vaguely remember being confused in the past about this behaviour. I think the problem is that MSYS applications only interpret virtualised paths if they are running under another MSYS application. In your case, if you run gcc from the MSYS shell, it can find "/usr/local/include". If you run it from a windows application (eg. the CMD shell, or OOC) it does not find "/usr/local/include" because it interprets that path as an absolute path. This behaviour must have changed in recent releases of MSYS, because README.WIN32 suggests that you use "/usr/local/include" so it must have worked for me at some stage. One solution is to NOT use /usr/local for your libraries, but some other directory which appears under the same path to both Windows and MSYS applications. This is what README.WIN32 suggests you do for your own source code, but it looks like you need to do this for any libraries that gcc needs to find. In my installation I have all my local files under "S:/stewart/local" which appears as "/stewart/local" under MSYS via this /etc/fstab mount: s:/stewart /stewart When I configure oo2c (and any installed libraries), I do "--prefix /stewart/local" so that any installed files go there and not to the default "/usr/local". I'm not sure if you still need to specify the path in LDFLAGS and CPPFLAGS, but I would do it anyway just in case. Please give this a try. If it works, I'll update the README.WIN32 to suggest this setup. Cheers, Stewart Bernhard Treutwein wrote: >>That does seem strange. Please try invoking the gcc command that failed >> from the msys command line. Does it normally fail to find the header, or >> just when invoked from oo2c? > > > just tried to invoke the gcc command by cut'n'paste: It works ok, when calling > directly. Then a make again proceeds until (oh, what a command line :-): > > gcc -o lib/bin/liboo2c -L/usr/local/lib lib/obj/RT0.o lib/obj/HashCode.o lib/obj/Object.o lib/obj/Exception.o lib/obj/Out0.o lib/obj/Ascii.o lib/obj/SysClock.o lib/obj/Time.o lib/obj/CharClass.o lib/obj/Strings.o lib/obj/LongStrings.o lib/obj/ConvTypes.o lib/obj/IntConv.o lib/obj/IntStr.o lib/obj/Msg.o lib/obj/Channel.o lib/obj/BinaryRider.o lib/obj/PosixFileDescr.o lib/obj/Termination.o lib/obj/StdChannels.o lib/obj/Real0.o lib/obj/LRealConv.o lib/obj/LRealStr.o lib/obj/RealConv.o lib/obj/RealStr.o lib/obj/TextRider.o lib/obj/Err.o lib/obj/Files.o lib/obj/In.o lib/obj/Log.o lib/obj/Out.o lib/obj/ProgramArgs.o lib/obj/RandomNumbers.o lib/obj/StringSearch.o lib/obj/IO.o lib/obj/IO/BinaryRider.o lib/obj/ADT/Storable.o lib/obj/ADT/StringBuffer.o lib/obj/Object/Boxed.o lib/obj/Object/BigInt.o lib/obj/ADT/Dictionary.o lib/obj/ADT/Comparator.o lib/obj/ADT/ArrayList.o lib/obj/Logger/TimeStamp.o lib/obj/IO/TextRider.o lib/obj/IO/StdChannels.o lib/obj/Logger.o lib/obj/IO/Address.o lib > /obj/IO/Socket.o lib/obj/OS/Path.o lib/obj/IO/Buffer.o lib/obj/IO/FileChannel.o lib/obj/IO/SocketChannel.o lib/obj/IO/Memory.o lib/obj/IO/Select.o lib/obj/ADT/LinkedList.o lib/obj/ADT/Dictionary/IntValue.o lib/obj/ADT/Dictionary/AddressKey.o lib/obj/ADT/Dictionary/AddressKey/IntValue.o lib/obj/ADT/Object/Storage.o lib/obj/ADT/Arrays.o lib/obj/StringSearch/SubstringBF.o lib/obj/StringSearch/RegexpParser.o lib/obj/StringSearch/SubstringBM.o lib/obj/StringSearch/RegexpDFA.o lib/obj/StringSearch/NoMatch.o lib/obj/libadt.o lib/obj/OS/Files.o lib/obj/OS/ProcessManagement.o lib/obj/OS/ProcessParameters.o lib/obj/URI/CharClass.o lib/obj/URI/String.o lib/obj/URI.o lib/obj/URI/Authority/RegistryBased.o lib/obj/URI/Authority/ServerBased.o lib/obj/URI/Authority/Unparsed.o lib/obj/URI/Error.o lib/obj/URI/Query/Unparsed.o lib/obj/URI/Scheme/Hierarchical.o lib/obj/URI/Scheme/Opaque.o lib/obj/URI/Scheme/CurrentDoc.o lib/obj/URI/Parser.o lib/obj/URI/Fragment/Unparsed.o lib/obj/URI/Query/W WWF > orm.o lib/obj/OS/HostPath.o lib/obj/URI/Scheme/File.o lib/obj/URI/Scheme/HTTP.o lib/obj/URI/Scheme/MailTo.o lib/obj/URI/Scheme/NNTP.o lib/obj/XML/UnicodeCodec.o lib/obj/XML/InputBuffer.o lib/obj/XML/UnicodeBuffer.o lib/obj/XML/DTD.o lib/obj/XML/Error.o lib/obj/XML/Locator.o lib/obj/XML/Builder.o lib/obj/XML/Builder/Canonical.o lib/obj/XML/Writer.o lib/obj/XML/Builder/ParserProtocol.o lib/obj/XML/UnicodeCodec/UTF8.o lib/obj/XML/EntityResolver.o lib/obj/XML/Builder/Namespaces.o lib/obj/XML/Regexp.o lib/obj/XML/UnicodeCodec/UTF16.o lib/obj/XML/Parser.o lib/obj/XML/Builder/Validation.o lib/obj/XML/UnicodeCodec/ASCII.o lib/obj/XML/UnicodeCodec/Latin1.o lib/obj/XML/UnicodeCodec/ImportAll.o lib/obj/XML/Basic/Element.o lib/obj/XML/Basic/Parser.o lib/obj/XML/Basic/DataType.o lib/obj/libxml.o lib/obj/Codec.o lib/obj/Codec/Ascii.o lib/obj/Codec/Latin1.o lib/obj/Codec/UU.o lib/obj/Codec/YEnc.o lib/obj/liboo2c.o lib/obj/liboo2c_.o -lmingwex -lwsock32 -lgc -L/usr/local/lib > > This command line fails with: > > d:ProgrammeMinGWbin..libgccmingw323.4.2........mingw32binld.exe: cannot find -lgc > collect2: ld returned 1 exit status > make: *** [lib/obj/liboo2c.la] Error 1 > > Trying the cut'n'paste trick again: works ok, calling again make yields the same error message. > > Any more ideas? > > regards > Bernhard |
|
From: August K. <fus...@co...> - 2006-07-10 23:58:19
|
Hi,
The session below demonstrates the problem.
[august src]$ oo2c --version
oo2c/gcc 2.1.10
[august src]$ cat Test.Mod
MODULE Test;
VAR x: LONGREAL;
BEGIN
x :=3D 2 * MAX(LONGREAL)
END Test.
[august src]$ oo2c -M -r .. Test.Mod
/home/august/prog/oberon/test/obj/Test.c: In function =91OOC_Test_init=92=
:
/home/august/prog/oberon/test/obj/Test.c:7: error: =91INF=92 undeclared=20
(first use in this function)
/home/august/prog/oberon/test/obj/Test.c:7: error: (Each undeclared=20
identifier is reported only once
/home/august/prog/oberon/test/obj/Test.c:7: error: for each function it=20
appears in.)
Regards,
August
|
|
From: Bernhard Treutwein<bd...@wi...> - 2006-07-10 22:04:15
|
Hi Stewart,
> That does seem strange. Please try invoking the gcc command that failed=
=20
> from the msys command line. Does it normally fail to find the header, or=
=20
> just when invoked from oo2c?
=20
just tried to invoke the gcc command by cut'n'paste: It works ok, when call=
ing=20
directly. Then a make again proceeds until (oh, what a command line :-):
gcc -o lib/bin/liboo2c -L/usr/local/lib lib/obj/RT0.o lib/obj/HashCode.o li=
b/obj/Object.o lib/obj/Exception.o lib/obj/Out0.o lib/obj/Ascii.o lib/obj/S=
ysClock.o lib/obj/Time.o lib/obj/CharClass.o lib/obj/Strings.o lib/obj/Long=
Strings.o lib/obj/ConvTypes.o lib/obj/IntConv.o lib/obj/IntStr.o lib/obj/Ms=
g.o lib/obj/Channel.o lib/obj/BinaryRider.o lib/obj/PosixFileDescr.o lib/ob=
j/Termination.o lib/obj/StdChannels.o lib/obj/Real0.o lib/obj/LRealConv.o l=
ib/obj/LRealStr.o lib/obj/RealConv.o lib/obj/RealStr.o lib/obj/TextRider.o =
lib/obj/Err.o lib/obj/Files.o lib/obj/In.o lib/obj/Log.o lib/obj/Out.o lib/=
obj/ProgramArgs.o lib/obj/RandomNumbers.o lib/obj/StringSearch.o lib/obj/IO=
.o lib/obj/IO/BinaryRider.o lib/obj/ADT/Storable.o lib/obj/ADT/StringBuffer=
.o lib/obj/Object/Boxed.o lib/obj/Object/BigInt.o lib/obj/ADT/Dictionary.o =
lib/obj/ADT/Comparator.o lib/obj/ADT/ArrayList.o lib/obj/Logger/TimeStamp.o=
lib/obj/IO/TextRider.o lib/obj/IO/StdChannels.o lib/obj/Logger.o lib/obj/I=
O/Address.o lib/obj/IO/Socket.o lib/obj/OS/Path.o lib/obj/IO/Buffer.o lib/o=
bj/IO/FileChannel.o lib/obj/IO/SocketChannel.o lib/obj/IO/Memory.o lib/obj/=
IO/Select.o lib/obj/ADT/LinkedList.o lib/obj/ADT/Dictionary/IntValue.o lib/=
obj/ADT/Dictionary/AddressKey.o lib/obj/ADT/Dictionary/AddressKey/IntValue.=
o lib/obj/ADT/Object/Storage.o lib/obj/ADT/Arrays.o lib/obj/StringSearch/Su=
bstringBF.o lib/obj/StringSearch/RegexpParser.o lib/obj/StringSearch/Substr=
ingBM.o lib/obj/StringSearch/RegexpDFA.o lib/obj/StringSearch/NoMatch.o lib=
/obj/libadt.o lib/obj/OS/Files.o lib/obj/OS/ProcessManagement.o lib/obj/OS/=
ProcessParameters.o lib/obj/URI/CharClass.o lib/obj/URI/String.o lib/obj/UR=
I.o lib/obj/URI/Authority/RegistryBased.o lib/obj/URI/Authority/ServerBased=
.o lib/obj/URI/Authority/Unparsed.o lib/obj/URI/Error.o lib/obj/URI/Query/U=
nparsed.o lib/obj/URI/Scheme/Hierarchical.o lib/obj/URI/Scheme/Opaque.o lib=
/obj/URI/Scheme/CurrentDoc.o lib/obj/URI/Parser.o lib/obj/URI/Fragment/Unpa=
rsed.o lib/obj/URI/Query/WWWForm.o lib/obj/OS/HostPath.o lib/obj/URI/Scheme=
/File.o lib/obj/URI/Scheme/HTTP.o lib/obj/URI/Scheme/MailTo.o lib/obj/URI/S=
cheme/NNTP.o lib/obj/XML/UnicodeCodec.o lib/obj/XML/InputBuffer.o lib/obj/X=
ML/UnicodeBuffer.o lib/obj/XML/DTD.o lib/obj/XML/Error.o lib/obj/XML/Locato=
r.o lib/obj/XML/Builder.o lib/obj/XML/Builder/Canonical.o lib/obj/XML/Write=
r.o lib/obj/XML/Builder/ParserProtocol.o lib/obj/XML/UnicodeCodec/UTF8.o li=
b/obj/XML/EntityResolver.o lib/obj/XML/Builder/Namespaces.o lib/obj/XML/Reg=
exp.o lib/obj/XML/UnicodeCodec/UTF16.o lib/obj/XML/Parser.o lib/obj/XML/Bui=
lder/Validation.o lib/obj/XML/UnicodeCodec/ASCII.o lib/obj/XML/UnicodeCodec=
/Latin1.o lib/obj/XML/UnicodeCodec/ImportAll.o lib/obj/XML/Basic/Element.o =
lib/obj/XML/Basic/Parser.o lib/obj/XML/Basic/DataType.o lib/obj/libxml.o li=
b/obj/Codec.o lib/obj/Codec/Ascii.o lib/obj/Codec/Latin1.o lib/obj/Codec/UU=
.o lib/obj/Codec/YEnc.o lib/obj/liboo2c.o lib/obj/liboo2c_.o -lmingwex -lws=
ock32 -lgc -L/usr/local/lib
This command line fails with:=20
d:ProgrammeMinGWbin..libgccmingw323.4.2........mingw32binld.exe: canno=
t find -lgc
collect2: ld returned 1 exit status
make: *** [lib/obj/liboo2c.la] Error 1
Trying the cut'n'paste trick again: works ok, calling again make yields the=
same error message.
Any more ideas?
regards
Bernhard
|
|
From: Michael v. A. <mic...@gm...> - 2006-07-03 05:49:28
|
On 01/07/06, Frank Copeland <fj...@th...> wrote: > > > On 28/06/06, *Frank Copeland* <fj...@th... > > <mailto:fj...@th...>> wrote: > [...] > > On the other hand, Module C declares a C string as: > > > > TYPE > > char* = CHAR; > > string* = POINTER [CSTRING] TO ARRAY OF char; > > Michael van Acken wrote: > > > The definition from C is in full > > > > string* = POINTER [NO_LENGTH_INFO, NO_DESCRIPTOR, CSTRING] TO ARRAY OF > > char; > > > > due to the implicit flags induced by INTERFACE. > > Does it matter whether the flags are attached to the POINTER part of the > declaration or the ARRAY part? Would: > > string* = POINTER [CSTRING] TO ARRAY [NO_LENGTH_INFO, NO_DESCRIPTOR] OF > char; > > be an equivalent declaration? My mistake. I have not checked with the actual implementation, but the NO_* flags are almost certainly attached to the ARRAY. Your declaration is the correct one. -- mva |
|
From: Frank C. <fj...@th...> - 2006-07-01 11:45:32
|
> On 28/06/06, *Frank Copeland* <fj...@th... > <mailto:fj...@th...>> wrote: [...] > For example, how is a C string declared? Module RT0 has these > declarations: > > TYPE > charPtr1d* = POINTER TO ARRAY [NO_LENGTH_INFO, NO_DESCRIPTOR] OF > CHAR; > charPtr2d* = POINTER TO ARRAY [NO_LENGTH_INFO, NO_DESCRIPTOR] OF > charPtr1d; [...] > On the other hand, Module C declares a C string as: > > TYPE > char* = CHAR; > string* = POINTER [CSTRING] TO ARRAY OF char; Michael van Acken wrote: > The definition from C is in full > > string* = POINTER [NO_LENGTH_INFO, NO_DESCRIPTOR, CSTRING] TO ARRAY OF > char; > > due to the implicit flags induced by INTERFACE. Does it matter whether the flags are attached to the POINTER part of the declaration or the ARRAY part? Would: string* = POINTER [CSTRING] TO ARRAY [NO_LENGTH_INFO, NO_DESCRIPTOR] OF char; be an equivalent declaration? > Both string and > charPtr1d describe the > same type structure in memory (by means of the NO_* flags), and are in > this sense both > correct. They differ if they appear on the left hand side of an > assignment, or as a for ||mal > parameter. The `string' type allows to pass string constants and > character arrays to the > pointer, while `charPtr1d' does not. > > Which to choose is basically a decision how much C semantics you prefer > in your > programs. 'string' is more convenient in formal parameter lists, simply > because > |SYSTEM.VAL(P,SYSTEM.ADR(a)) is so cumbersome. I want ultimately to hide the C semantics behind a module interface but need to access them in full to implement it. Thanks for the clarification. -- Frank |
|
From: Michael v. A. <mic...@gm...> - 2006-06-28 18:30:53
|
Hi Frank, it has been some time since I had to do interfacing to C libraries myself. I had to do some reading myself to recall this stuff, so bear with me if my first attempt at an explanation falls short... On 28/06/06, Frank Copeland <fj...@th...> wrote: > > I'm trying to get a deeper understanding of how system flags affect the > behaviour of types, particularly types equivalent to C strings, structures > and arrays. I need to know this to implement interface modules for C > libraries and Oberon modules manipulating C types such as strings. > > SymbolTable.Mod gives the following list of flags: > > NO_COPY, ABSTRACT, NO_LENGTH_INFO, NO_DESCRIPTOR, NOT_EXTENSIBLE, > EXTENSIBLE, UNCHECKED_EXCEPTION, CSTRING, NIL_COMPAT, UNION, READ_ONLY, > NO_RETURN, DEPRECATED, OOC_EXTENSIONS, ALIGN1, ALIGN2, ALIGN4, ALIGN8, > VTABLE, NO_TRACED_POINTERS > > It would be good to have a description of these flags like the one in > OOCRef > for OOC v1. However, the ones I believe are relevant to me are: > > NO_LENGTH_INFO, NO_DESCRIPTOR, CSTRING, NIL_COMPAT, UNION > > I'm pretty sure I grok NIL_COMPAT and UNION. I'm less sure of the > interaction of NO_LENGTH_INFO, NO_DESCRIPTOR and CSTRING. Both NO_LENGTH_INFO and NO_DESCRIPTOR denote the absence of certain run-time type information normally associated with Oberon types. These flags are implicity set for types defined in INTERFACE modules, but must be explicitly set in FOREIGN modules. CSTRING relaxes the assignment rules. When set for a pointer type, compatible _array_ values can be assigned to the variable. In this case, the pointer variable takes the address of the right hand side of the assignment. For example, how is a C string declared? Module RT0 has these declarations: > > TYPE > charPtr1d* = POINTER TO ARRAY [NO_LENGTH_INFO, NO_DESCRIPTOR] OF CHAR; > charPtr2d* = POINTER TO ARRAY [NO_LENGTH_INFO, NO_DESCRIPTOR] OF > charPtr1d; > > These types represent the arguments passed to a C program in the 'argv' > parameter of the 'main' function. The C declaration varies, but is usually > either: > > char * argv[]; > > or > > char ** argv; > > On the other hand, Module C declares a C string as: > > TYPE > char* = CHAR; > string* = POINTER [CSTRING] TO ARRAY OF char; > > The equivalent C declaration would be: > > char * whatever > > In theory C.string and RT0.charPtr1d should be equivalent but the compiler > understandably treats them as different types. Which one is correct? The definition from C is in full string* = POINTER [NO_LENGTH_INFO, NO_DESCRIPTOR, CSTRING] TO ARRAY OF char; due to the implicit flags induced by INTERFACE. Both string and charPtr1d describe the same type structure in memory (by means of the NO_* flags), and are in this sense both correct. They differ if they appear on the left hand side of an assignment, or as a formal parameter. The `string' type allows to pass string constants and character arrays to the pointer, while `charPtr1d' does not. Which to choose is basically a decision how much C semantics you prefer in your programs. 'string' is more convenient in formal parameter lists, simply because SYSTEM.VAL(P,SYSTEM.ADR(a)) is so cumbersome. -- mva |
|
From: Frank C. <fj...@th...> - 2006-06-28 14:57:14
|
I'm trying to get a deeper understanding of how system flags affect the
behaviour of types, particularly types equivalent to C strings, structures
and arrays. I need to know this to implement interface modules for C
libraries and Oberon modules manipulating C types such as strings.
SymbolTable.Mod gives the following list of flags:
NO_COPY, ABSTRACT, NO_LENGTH_INFO, NO_DESCRIPTOR, NOT_EXTENSIBLE,
EXTENSIBLE, UNCHECKED_EXCEPTION, CSTRING, NIL_COMPAT, UNION, READ_ONLY,
NO_RETURN, DEPRECATED, OOC_EXTENSIONS, ALIGN1, ALIGN2, ALIGN4, ALIGN8,
VTABLE, NO_TRACED_POINTERS
It would be good to have a description of these flags like the one in OOCRef
for OOC v1. However, the ones I believe are relevant to me are:
NO_LENGTH_INFO, NO_DESCRIPTOR, CSTRING, NIL_COMPAT, UNION
I'm pretty sure I grok NIL_COMPAT and UNION. I'm less sure of the
interaction of NO_LENGTH_INFO, NO_DESCRIPTOR and CSTRING.
For example, how is a C string declared? Module RT0 has these declarations:
TYPE
charPtr1d* = POINTER TO ARRAY [NO_LENGTH_INFO, NO_DESCRIPTOR] OF CHAR;
charPtr2d* = POINTER TO ARRAY [NO_LENGTH_INFO, NO_DESCRIPTOR] OF charPtr1d;
These types represent the arguments passed to a C program in the 'argv'
parameter of the 'main' function. The C declaration varies, but is usually
either:
char * argv[];
or
char ** argv;
On the other hand, Module C declares a C string as:
TYPE
char* = CHAR;
string* = POINTER [CSTRING] TO ARRAY OF char;
The equivalent C declaration would be:
char * whatever
In theory C.string and RT0.charPtr1d should be equivalent but the compiler
understandably treats them as different types. Which one is correct?
--
> When there isn't sufficient virtual memory, the compiler bails out,
> giving an internal error message. When I kill some processes, the
> error goes away.
And what is the compiler supposed to do instead? Go shopping for you
and buy more memory?
-- Falk Hueffner, on the GNU C++ compiler
|
|
From: Stewart G. <sgr...@ii...> - 2006-06-27 22:29:57
|
Hi Bernhard, That does seem strange. Please try invoking the gcc command that failed from the msys command line. Does it normally fail to find the header, or just when invoked from oo2c? Cheers, Stewart Bernhard Treutwein wrote: > Hi Stewart, > > [...] > >>>I suggest that you first try to bootstrap the system without using >>>libtool. This means using "./configure --disable-libs" so that you get >>>static linking, rather than trying to build shared libraries. AFAIK, >>>oo2c+libtool is untested under mingw/msys. At least in recent releases, >>>oo2c should not be bothered by Windows path names, and neither should >>>gcc. Can't say the same for libtool though... >>> >>> From README.WIN32, the full configure command for msys looks something >>>like this: >>> env >>> "INSTALL=c:/msys/1.0/bin/install.exe" >>> LDFLAGS=-L/usr/local/lib >>> CFLAGS=-O2 >>> "CPPFLAGS=-I/usr/local/include -DGC_WIN32_THREADS" >>> ./configure --disable-libs >>> > > > I tried that, but it did not work out. The bootstrapping dos not get beyond > the same > point, this time with different error messages (second try to "make"): > > $ make > stage0/oo2c --config oo2crc-install.xml -v -r lib -r . --build-package > liboo2c > - D:/Programme/Msys/1.0/src/OO2C/oo2c_32-2.1.10/lib/pkginfo.xml > - D:/Programme/Msys/1.0/src/OO2C/oo2c_32-2.1.10/pkginfo.xml > - lib/sym/liboo2c.Sym > - lib/sym/liboo2c.Doc > - lib/sym/RT0.Sym > > ... more stuff from the lib ... > > - lib/sym/Codec/Latin1.Doc > - lib/sym/Codec/UU.Sym > - lib/sym/Codec/UU.Doc > - lib/sym/Codec/YEnc.Sym > - lib/sym/Codec/YEnc.Doc > gcc -O2 -I/usr/local/include -DGC_WIN32_THREADS -Ilib/src -Iobj -Ilib/obj -I > /usr/src/OO2C/oo2c_32-2.1.10/obj -I/usr/src/OO2C/oo2c_32-2.1.10/lib/obj -c > D:/Programme/Msys/1.0/src/OO2C/oo2c_32-2.1.10/lib/src/RT0.c -o lib/obj/RT0.o > D:/Programme/Msys/1.0/src/OO2C/oo2c_32-2.1.10/lib/src/RT0.c:19:21: gc/gc.h: > No such file or directory > D:/Programme/Msys/1.0/src/OO2C/oo2c_32-2.1.10/lib/src/RT0.c:86: error: > syntax error before "ptr" > D:/Programme/Msys/1.0/src/OO2C/oo2c_32-2.1.10/lib/src/RT0.c: In function > `HandleFinalize': > D:/Programme/Msys/1.0/src/OO2C/oo2c_32-2.1.10/lib/src/RT0.c:88: error: `ptr' > undeclared (first use in this function) > > ... more compiler error messages ... > > make: *** [lib/obj/liboo2c.la] Error 1 > > Bernhard@JANUS /src/OO2C/oo2c_32-2.1.10 > $ ll /usr/local/include/gc/gc.h > -rw-r--r-- 1 Bernhard Administ 44551 Jun 22 19:29 > /usr/local/include/gc/gc.h > > strange enough /usr/local/include/gc/gc.h is available, but gcc does not > find it despite having > the correct path ... > > I still don't have any clue. > > regards and thanks so far > > Bernhard > > > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > ooc-compiler mailing list > ooc...@li... > https://lists.sourceforge.net/lists/listinfo/ooc-compiler > |