Muki-SkyWalker / anic

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

Build fail #9

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Clone the HG repository
2. Make

What is the expected output? What do you see instead?
Expected that the compiler can be built. I get an error instead

What version of the product are you using? On what operating system?
Running Ubuntu Maverick with GCC --version :
cc (Ubuntu/Linaro 4.4.4-14ubuntu5) 4.4.5

Please provide any additional information below.
$ hg clone https://anic.googlecode.com/hg/ anic
requesting all changes
adding changesets
adding manifests
adding file changes
added 723 changesets with 1862 changes to 81 files (+1 heads)
updating to branch default
60 files updated, 0 files merged, 0 files removed, 0 files unresolved

$ cd anic/

$ make
anic ANI Compiler Makefile

Building version controller...
Building lexer structure generator...
Generating lexer structures...
Compiling lexer structure object...
Building parser structure generator...
Building parser table generator...
Constructing parser table...
Generating parser structures...
Stamping version...
Version stamp is 0.74.1.79894644
Building main executable...
src/types.cpp: In member function ‘TypeStatus::operator uintptr_t() const’:
src/types.cpp:1514: error: cast from ‘Type*’ to ‘unsigned int’ loses 
precision
src/genner.cpp: In member function ‘std::string WordTree64::toString(unsigned 
int) const’:
src/genner.cpp:220: warning: format ‘%08llX’ expects type ‘long long 
unsigned int’, but argument 3 has type ‘long unsigned int’
make: *** [anic] Erreur 1

Original issue reported on code.google.com by pierr...@gmail.com on 13 Nov 2010 at 6:18

GoogleCodeExporter commented 9 years ago
The loss of precision error is identical to the build failure reported under 
Mac OS X when the target platform is x86_64. The solution is the same: change 
the cast from `(unsigned int)` to `(uintptr_t)`. This avoids assumptions about 
pointer width.

One way to avoid the format error is to cast the argument to match the expected 
type. However, since the declared type of the value is `uint64_t`, a better 
solution would likely be:

    #define __STDC_FORMAT_MACROS
    #include <inttypes.h>

and then use the format specifier `PRIx64`.

A patch is attached.

Original comment by jeremyw....@gmail.com on 16 Nov 2010 at 2:02

Attachments:

GoogleCodeExporter commented 9 years ago
Issue 10 has been merged into this issue.

Original comment by dkers...@gmail.com on 17 Nov 2010 at 7:38

GoogleCodeExporter commented 9 years ago
the patch that jermy made worked great for me running 64bit ubuntu i think it 
shoul be applied to the main repo

Original comment by ca...@callesag.se on 18 Aug 2012 at 8:57