lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-devel] [bug #49827] wrong cast to size_t on 16-bit x86 architectur


From: Alexander
Subject: [lwip-devel] [bug #49827] wrong cast to size_t on 16-bit x86 architecture
Date: Mon, 12 Dec 2016 19:16:37 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:50.0) Gecko/20100101 Firefox/50.0

Follow-up Comment #7, bug #49827 (project lwip):

I use OpenWatcom compiler and have next line in headers:
typedef int ptrdiff_t;
(source
https://github.com/open-watcom/open-watcom-v2/blob/master/bld/hdr/ptrdifft.sp#L48)

int in my system is 16 bit (intel 80186 clone)
pointer size depends on memory model that I use. 
If I use SMALL memory model, so pointer size is 16 bit (only 16bit offset to
default data segment) and default LWIP_CONST_CAST works in this case.
But SMALL data model allows me to use only 64Kb of data, because of that I
have to use LARGE memory model, where 
pointer size is 32 bit (16 bit offset + 16 bit segment), so in this case (my
default scenario) I need to override LWIP_CONST_CAST.

I think that if I choose HUGE memory model, so ptrdiff_t will be long:
typedef long ptrdiff_t;
but in this case overhead of pointers usage will appear.

I don't know how to write LWIP_CONST_CAST to be more portable to my case.
I have the same problems with other community projects.

I realize that DOS is dead, but not quite dead.


    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?49827>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]