[Mono-bugs] [Bug 333808] New: MonoCurses does not compile on x86-64 platforms

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Oct 15 06:01:03 EDT 2007


https://bugzilla.novell.com/show_bug.cgi?id=333808

           Summary: MonoCurses does not compile on x86-64 platforms
           Product: Mono: Class Libraries
           Version: unspecified
          Platform: x86-64
        OS/Version: Ubuntu
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Mono.POSIX
        AssignedTo: miguel at novell.com
        ReportedBy: directhex at hotmail.com
         QAContact: mono-bugs at ximian.com
          Found By: Customer


Description of Problem:
MonoCurses is unable to build correctly on x86-64.



Steps to reproduce the problem:
1. Attempt to run "make" on MonoCurses on an x86-64 machine



Actual Results:
if test `uname` = Darwin; then make t-bugosx; else make detect; fi
make[1]: Entering directory `/tmp/mono-curses'
echo "main () {initscr();}" > tmp.c
gcc tmp.c -lncurses -o tmp
make binding CURSES=`ldd ./tmp  | grep ncurses | awk '{print $3}' | sed
's#.*libncurses#ncurses#'`
make[2]: Entering directory `/tmp/mono-curses'
sed -e 's/@CURSES@/ncurses.so.5/' -e 's/@MONO_CURSES@/mono-curses/' <
binding.cs.in > binding.cs
make[2]: Leaving directory `/tmp/mono-curses'
make[1]: Leaving directory `/tmp/mono-curses'
gcc -o attrib attrib.c  -lncurses
/attrib constants.cs
gmcs -doc:mono-curses.xml -debug -target:library -out:mono-curses.dll -debug
handles.cs binding.cs gui.cs constants.cs
constants.cs(53,26): error CS0031: Constant value `4294967295' cannot be
converted to a `int'
Compilation failed: 1 error(s), 0 warnings
make: *** [mono-curses.dll] Error 1



Expected Results:
if test `uname` = Darwin; then make t-bugosx; else make detect; fi
make[1]: Entering directory `/tmp/mono-curses'
echo "main () {initscr();}" > tmp.c
gcc tmp.c -lncurses -o tmp
make binding CURSES=`ldd ./tmp  | grep ncurses | awk '{print $3}' | sed
's#.*libncurses#ncurses#'`
make[2]: Entering directory `/tmp/mono-curses'
sed -e 's/@CURSES@/ncurses.so.5/' -e 's/@MONO_CURSES@/mono-curses/' <
binding.cs.in > binding.cs
make[2]: Leaving directory `/tmp/mono-curses'
make[1]: Leaving directory `/tmp/mono-curses'
gcc -o attrib attrib.c  -lncurses
/attrib constants.cs
gmcs -doc:mono-curses.xml -debug -target:library -out:mono-curses.dll -debug
handles.cs binding.cs gui.cs constants.cs
if test `uname` = Darwin; then gcc -dynamiclib mono-curses.c -o
libmono-curses.dylib -lncurses; else gcc -g -shared -fPIC mono-curses.c -o
libmono-curses.so -lncurses; fi
if pkg-config --atleast-version=0.1 monotorrent; then \
                cp `pkg-config --variable=Libraries monotorrent` .; \
        else \
                echo You must install The Monotorrent libraries first;  \
                exit 1; \
        fi
You must install The Monotorrent libraries first
make: *** [MonoTorrent.dll] Error 1



How often does this happen? 
Every time



Additional Information:
The error occurs because a constant defined in constants.cs is larger than the
largest number that can be stored in a .NET "int" object. constants.cs is a
machine-generated file, made by a small C program called attrib. attrib simply
writes out a number of integer constants defined in the system's ncurses.h C
header. However, the main method to do this looks like this:
#define put(x) fprintf (OUT, "\tpublic const int " #x " = %ld;\n", x)
The input types are all C "int", and the generated .cs file defines all the
constants as a .NET "int" - but the printf here interprets all the values in
ncurses.h with %ld, i.e. a "long int". Using "long int" here doesn't match up
with the input OR output, and is the reason that the input value from
ncurses.h:
#define ERR     (-1)
is written to constants.cs as:
        public const int ERR = 4294967295;

This "%ld" should be changed to "%d", which is correct (given the input and
output data types) and allows the assembly to compile fine


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list