AeroEng43 / shedskin

Automatically exported from code.google.com/p/shedskin
0 stars 0 forks source link

A couple of compiler errors and deprecated warnings. #20

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Out of the box, shedskin will fail to compile. This is because builtin.cpp
and sys.cpp are missing some necessary header includes.

builtin.cpp is missing "#include <cstring>". It needs this file because it
uses memcpy. sys.cpp is missing "#include <climits>". It needs this file
because it uses INT_MAX.

I am using g++ 4.3. Earlier versions of g++ were more forgiving when you
did not include necessary header files. g++ versions are becoming stricter
in that regard.

I'll add to this bug if I find any other cpp files missing includes.

Also, when building, I get a bunch of deprecation warnings that cloud the
output. Apparently, builtin.cpp includes ext/hash_map and ext/hash_set,
which are declared to be deprecated. They expect you to include
unordered_set and unordered_map instead. I'm not sure how far back these
new headers go, as in, I'm not sure which versions of g++ include these
headers. I recommend either upgrading to the new headers, or just adding
-Wno-deprecated to the CCFLAGS line.

I am using the latest stable version of shedskin (0.0.28) on a Debian
system, with g++ 4.3.

Original issue reported on code.google.com by winterkn...@nerdshack.com on 23 Aug 2008 at 6:36

GoogleCodeExporter commented 8 years ago
thanks for looking into this. I was aware of the missing <cstring> include, but 
not
of <climits> and Wno-deprecated. I have added these (the latter hopefully only
temporarily) to SVN.

could you please run the compiler test set as 'python unit.py', to see if there 
are
any other issues with 4.3..? warning: this can take a long time.

btw, there is no such thing as a stable version of shedskin.. :) so it's 
probably
best to always test from SVN.

Original comment by mark.duf...@gmail.com on 23 Aug 2008 at 7:05

GoogleCodeExporter commented 8 years ago
I'm running the test suite right now. I actually started it about half an hour 
ago,
but didn't think to save the output in a text file. I noticed a few exceptions 
and
such, but the test just kept going, and it was already past what my xterm would 
save,
so I started again. I'll post the result here when it is done.

I would hold off on switching the hash functions to unordered_*. I just tried
compiling this program with g++:

#include <unordered_map>
int main(int argc, char ** argv) {}

and I got a bunch of error messages about how this is experimental code, and 
that g++
would refuse to compile it unless "-std=c++0x" was added to the command line.

Previous c++ standards did not have hash functions, and so compiler vendors, 
such as
g++, would add their own extensions, such as hash_set and hash_map. But the 
upcoming
standard has hash functions, and so g++ is using those instead, and, in my 
opinion,
has deprecated hash_set and hash_map prematurely. I would just leave your code 
as it
is until the next c++ standard comes out, which might be years from now.

Original comment by winterkn...@nerdshack.com on 23 Aug 2008 at 8:53

GoogleCodeExporter commented 8 years ago
Here are the results for unit test. It occurred to me a little late that using 
the
version from svn would have been more useful.

Shedskin: 0.0.28
OS: Debian Testing
g++: 4.3.1-2
python: 2.5.2-1

Original comment by winterkn...@nerdshack.com on 23 Aug 2008 at 9:53

Attachments:

GoogleCodeExporter commented 8 years ago

Original comment by mark.duf...@gmail.com on 26 Aug 2008 at 3:22

GoogleCodeExporter commented 8 years ago
yes.. could you please rerun again, using SVN..? :) thanks!

Original comment by mark.duf...@gmail.com on 26 Aug 2008 at 3:25

GoogleCodeExporter commented 8 years ago
Shedskin: svn 314
OS: Debian Testing
g++: 4.3.1-2
python: 2.5.2-1

Original comment by winterkn...@nerdshack.com on 26 Aug 2008 at 7:21

Attachments:

GoogleCodeExporter commented 8 years ago
looks perfect, thanks again :)

Original comment by mark.duf...@gmail.com on 26 Aug 2008 at 9:04