lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] [patch #5846] struct sockaddr_in has different alignment th


From: Simon Goldschmidt
Subject: [lwip-devel] [patch #5846] struct sockaddr_in has different alignment than struct sockaddr
Date: Fri, 06 Apr 2007 11:01:07 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3

Follow-up Comment #4, patch #5846 (project lwip):

Example of code that causes the warning:
lwip_bind(int s, struct sockaddr *name, socklen_t namelen)
{
...
  local_addr.addr = ((struct sockaddr_in *)name)->sin_addr.s_addr;

other places (always 'cast increases required alignment of target type'):
In function `lwip_bind':
lines 230, 232, 233
In function `lwip_connect':
lines 290, 292, 299, 300
In function `lwip_sendto':
lines  527, 532, 533

I'm using gcc version 3.4.1 (Altera Nios II 5.1 b93). The NIOS-II processor
has 4 byte alignment requirement (much like ARM processors) and I have the
following gcc options (some of them are for my C++ code:
-Wall
-ggdb
-fno-exceptions
-Wextra
-fverbose-asm
-Wparentheses
-Wswitch
-Wno-unused-parameter
-Wfloat-equal
-Wshadow
-Wcast-align
-Wno-unused-function
-Werror
-O0
-mhw-mul
-mno-hw-mulx
-mno-hw-div

Please tell me if you know a better way to remove this warning (personally, I
can understnad the compiler complaining about the cast :)

Thanks,
Simon

    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/patch/?5846>

_______________________________________________
  Nachricht geschickt von/durch Savannah
  http://savannah.nongnu.org/





reply via email to

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