Yes, there are issues with LLVM from TOT, and they are currently doing
more changes to the JIT API which break backward compatibility again.
I'm waiting for the dust to settle. Meanwhile, if someone already has a
patch which makes Pure compile and run with TOT again, I'll be happy to
apply it.
Albert
--
Dr. Albert Gr"af
Dept. of Music-Informatics, University of Mainz, Germany
Email: Dr.G...@t-online.de, a...@muwiinfa.geschichte.uni-mainz.de
WWW: http://www.musikinformatik.uni-mainz.de/ag
In file included from Signals.cpp:30:
Unix/Signals.inc: In function ‘void<unnamed>::PrintStackTrace()’:
Unix/Signals.inc:81: error: invalid conversion from ‘const char*’ to
‘char*’
Unix/Signals.inc:96: error: invalid conversion from ‘const char*’ to
‘char*’
Any quick fix ideas?
Cheers, Libor
Simply add an explicit cast:
const char* name = (const char*)strrchr(dlinfo.dli_fname, '/');
This error occurs with the newest GCC versions - there is likely sticter
type checking than in older versions.
Jiri
> Simply add an explicit cast:
> const char* name = (const char*)strrchr(dlinfo.dli_fname, '/');
Jirko, thank you for the hint. Actually, these two lines in my
copy of the source demand (char*) cast to work, as follows:
char* name = (char*)strrchr(dlinfo.dli_fname, '/');
So it is not quite the usual case of "constant poisoning".
Is it just me finding myself spending 90% of my time
fixing things intended to make programming safe?
I wish they would give it a rest....
Libor
> So it is not quite the usual case of "constant poisoning". Is it just
> me finding myself spending 90% of my time fixing things intended to
> make programming safe? I wish they would give it a rest....
No, it's C++. In C++ there are fifty ways to do anything, 49 of
which are wrong (including the straightforward and obvious way). C++
is a high level language masquerading as a high level language. C++
is a programming language that induces paranoia in its users: you dare
not trust your compiler, your libraries, your fellow programmers, or
(above all) yourself not to shoot you in the foot (which causes your
leg to be amputated).
I could go on....
--
John Cowan <co...@ccil.org> http://www.ccil.org/~cowan
One time I called in to the central system and started working on a big
thick 'sed' and 'awk' heavy duty data bashing script. One of the geologists
came by, looked over my shoulder and said 'Oh, that happens to me too.
Try hanging up and phoning in again.' --Beverly Erlebacher
> No, it's C++. In C++ there are fifty ways to do anything, 49 of
> which are wrong (including the straightforward and obvious way). C++
> is a high level language masquerading as a high level language.
Er, that's "low level language masquerading as a high level language".
--
John Cowan co...@ccil.org http://ccil.org/~cowan
Female celebrity stalker, on a hot morning in Cairo:
"Imagine, Colonel Lawrence, ninety-two already!"
El Auruns's reply: "Many happy returns of the day!"
I guess that dlinfo.dli_fname is a const char* in which case the C++
incarnation of strrchr makes the return type a const char* too (see
http://www.cplusplus.com/reference/clibrary/cstring/strrchr/). Which
makes sense if you think about it, as the result of strrchr points into
the const char* argument, so it should be a const char* as well.
This must be a recent change or fix in the g++ library, as I don't have
the const char* variation of strrchr in my cstring header, so I don't
see this error with gcc 4.3.
But anyway, the proper fix would be to make 'name' a const char*, which
actually is how it's declared in the corresponding LLVM 2.6 source.
> Is it just me finding myself spending 90% of my time
> fixing things intended to make programming safe?
> I wish they would give it a rest....
I know that feeling. :) Yeah, const can drive you crazy, because it
"ripples through." People often just give up and cast stuff to char*,
which of course defeats the purpose.
Another reason why (purely) functional programming is so nice;
everything is 'const' anyway, so you don't even have to think about it. :)
Albert
> This must be a recent change or fix in the g++ library, as I don't have
> the const char* variation of strrchr in my cstring header, so I don't
> see this error with gcc 4.3.
Yes, this was gcc 4.4.1 and I get constant poisoning in other C++ code
too.
I don't write C++ code myself, as I agree with John and avoid it like
a plague.
Give me plain honest C anyday, that does not masquerade as anything.
In C you can also write it in 50 different ways but they will all
work :)
On the other hand, in Java, you must write one-liner "Hello World" in
50 lines :)
> Another reason why (purely) functional programming is so nice;
> everything is 'const' anyway, so you don't even have to think about it. :)
This is an excellent point. Put that in the primer?
Libor
Continuing the saga, Jeffrey Yasskin has fixed the TCO-related LLVM JIT
breakage. I've also committed some more fixes for LLVM 2.7 compatibility
to Pure svn, so the latest svn sources of Pure should work with the
current LLVM 2.7svn again.
That's good news. At least chances are good now that Pure will work with
LLVM 2.7 when it comes out.
Ryan, that also means that Pure *might* work with LLVM 2.7 on Snow
Leopard in 64 bit now. It would be great if you could give this a try
when Pure 0.43 gets released.
Libor