[coyotos-dev] BigNum.cxx buglet? - CAPIDL_U32

Jeroen Visser jeroen.c.visser at gmail.com
Sun Oct 21 19:50:12 EDT 2007


Hello Dex,

I hacked around the problem for now and haven't really fixed the
issue. The problem seems to be here:

"capidl/backend/o_c_hdr.cxx" line 2548 of 3317 --76%-- col 12:
      else {
        unsigned long sig = s->CodedName();
        size_t indent = out.indent_for_macro();
        out << "\n#define OC_"
            << s->QualifiedName('_')
            << " CAPIDL_U32(0x"
            << std::hex << sig << std::dec
            << ")\n";
        out.indent(indent);


The "unsigned long sig" should be reduced to something that is 32 bits
in length. How exactly it is to be truncated I don't know yet. I use
an ugly cast in capidl.h to get around it for now:

diff -r b68e1214e2d2 src/sys/coyotos/capidl.h
--- a/src/sys/coyotos/capidl.h  Sun Oct 21 12:54:43 2007 -0400
+++ b/src/sys/coyotos/capidl.h  Tue Oct 16 18:34:36 2007 -0400
@@ -33,7 +33,7 @@ typedef uint64_t errcode_t;

 #define CAPIDL_U8(x)  x##u
 #define CAPIDL_U16(x) x##u
-#define CAPIDL_U32(x) x##ul
+#define CAPIDL_U32(x) (uint32_t)((long long)(x##ull & 0xFFFFFFFF))
 #define CAPIDL_U64(x) x##ull

 #define CAPIDL_I8(x)  x


-JCV


On 10/21/07, dx dx <dxtros at gmail.com> wrote:
> Hi,
>
> I have the same problem, but I don't know how Jeroen solved this, because he
> got a successful build.
>
> #define OC_coyotos_Cap_destroy CAPIDL_U32(0x286edb7ce18201ff)
> #define OC_coyotos_Cap_getType CAPIDL_U32(0x818e2c564701051a)
>
> line 255:   _params.in._opCode = OC_coyotos_Cap_destroy;
> line 406:   _params.in._opCode = OC_coyotos_Cap_getType;
>
> /usr/bin/ccache /coyotos/host/bin/i386-unknown
> -coyotos-gcc -g  -finline-limit=3000 -fno-strict-aliasing
> -I../../../../../sys -I../../../../../sys/idl/BUILD/h
> -IBUILD  -Wall -Winline -Wno-format -Wno-char-subscripts -Werror -M -MT
> BUILD/openrcv- data.o -MF BUILD/.openrcv-data.m openrcv-data.c
> /usr/bin/ccache /coyotos/host/bin/i386-unknown-coyotos-gcc
> -g  -finline-limit=3000 -fno-strict-aliasing -I../../../../../sys
> -I../../../../../sys/idl/BUILD/h -IBUILD  -Wall -Winline
> -Wno-format -Wno-char-subscripts -Werror -c openrcv-data.c -o
> BUILD/openrcv-data.o
> cc1: warnings being treated as errors
> In file included from openrcv-data.c:3:
> ../../../../../sys/idl/BUILD/h/idl/coyotos/Cap.h: In
> function 'IDL_ENV_coyotos_Cap_destroy':
>  ../../../../../sys/idl/BUILD/h/idl/coyotos/Cap.h:255:
> warning: integer constant is too large for 'unsigned long' type
> ../../../../../sys/idl/BUILD/h/idl/coyotos/Cap.h:255:
> warning: large integer implicitly truncated to unsigned type
> ../../../../../sys/idl/BUILD/h/idl/coyotos/Cap.h: In
> function 'IDL_ENV_coyotos_Cap_getType':
> ../../../../../sys/idl/BUILD/h/idl/coyotos/Cap.h:406:
> warning: integer constant is too large for 'unsigned long' type
>  ../../../../../sys/idl/BUILD/h/idl/coyotos/Cap.h:406:
> warning: large integer implicitly truncated to unsigned type
> make[4]: *** [BUILD/openrcv-data.o] Error 1
> make[4]: Leaving directory
> `/eif/coyotos/src/sys/arch/i386/test-image/by-hand'
> *** RECURSIVE BUILD STOPS ***
> make[3]: *** [recurse] Error 1
> make[3]: Leaving directory `/eif/coyotos/src/sys'
> *** RECURSIVE BUILD STOPS ***
> make[2]: *** [recurse] Error 1
> make[2]: Leaving directory `/eif/coyotos/src'
> make[1]: *** [packages] Error 2
> make[1]: Leaving directory `/eif/coyotos/src'
> make: *** [world] Error 2
>
> System:
> AMD64
> Ubuntu 7.10
>
> Thanks,
> dex
> _______________________________________________
> coyotos-dev mailing list
> coyotos-dev at smtp.coyotos.org
> http://www.coyotos.org/mailman/listinfo/coyotos-dev
>
>


More information about the coyotos-dev mailing list