Erlang/OTP Forums

Author Message

<  Open Telecom Platform (OTP)  ~  Compiler warnings with the ei marshall example

LeHoff
Posted: Thu Jun 28, 2007 3:04 pm Reply with quote
User Joined: 28 Nov 2006 Posts: 38
In http://www.trapexit.org/index.php/How_to_use_ei_to_marshal_binary_terms_in_port_programs it is nicely shown how to do a C port.

However, I have a question: why does the example use 'unsigned char' as type for the buffer elements?

The entire ei library expects 'char' as type for the buffer elements so this code generates a .... load of warnings when you compile it.

Any issues with changing the example to have 'char' as type for the buffer elements?

Thanks in advance,
Torben
View user's profile Send private message
asergey
Posted: Fri Jun 29, 2007 1:39 am Reply with quote
User Joined: 12 Mar 2005 Posts: 313
You are right indeed. Most of this code was a copy/paste exercise from another project that definition of a byte was wrongfully reused. I made a correction in the article.

Serge
View user's profile Send private message
LeHoff
Posted: Fri Jun 29, 2007 8:02 am Reply with quote
User Joined: 28 Nov 2006 Posts: 38
Super - I thought that there was something odd happening.

I will incorporate the change in my code.

Thanks,
Torben
View user's profile Send private message

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum