After being subscribed to this list for a while,  the list is
apparently alive. Seems like my message was sent at the worng time.

Nikolas,
What's your view on using a buffer with a size known only at runtime?

Thanks,
Alex

Alexander Nasonov wrote:
> Hi,
> 
> CMSG_SPACE(sizeof(int)) does not return a constant on NetBSD.
> If you compile tmux with the Intel C++ compiler 11.1, the program
> will crash in msgbuf_write because the compiler can't deduce a size
> of buf and sets it to 0:
> 
>       union {
>               struct cmsghdr  hdr;
>               char            buf[CMSG_SPACE(sizeof(int))];
>       } cmsgbuf;
> 
> and the result of sizeof(buf) is 0. This leads to a crash.
> 
> Any chance to get this fixed in the next version?
> 
> Thanks,
> Alex
> 
> PS see this commit message in NetBSD repository for more information about 
> CMSG_SPACE:
> 
> http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/sys/socket.h?only_with_tag=MAIN#rev1.51
> 
> Revision 1.51 / (download) - annotate - [select for diffs], Thu Mar 2 
> 07:41:50 2000 UTC (9 years, 8 months ago) by itojun 
> Branch: MAIN 
> Changes since 1.50: +10 -4 lines
> Diff to previous 1.50 (colored) 
> 
> make CMSG_ALIGN always synchronize with kernel's idea of ALIGNBYTES.
> ancillary data alignment will be ALIGNBYTES, not sizeof(long) - 1, from now.
> 
> CMSG_xx will NOT resolve into constant.  if you use CMSG_xx to allocate
> arrays, you'll lose.
> 
> bump shlib minor for libc.
> 
> NOTE: if you are on top of arch with ALIGNBYTES != sizeof(long) - 1,
> you need to recompile IPv6-related binaries.  there is no way to guarantee
> backward compat in this aspect.  sorry for this.  this should be the last
> backward compat breakage for IPv6-related ancillary data manipulation.
> (we still have PR 9516 for unix-domain sockets...)
> 
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
> trial. Simplify your report design, integration and deployment - and focus on 
> what you do best, core application coding. Discover what's new with
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> _______________________________________________
> tmux-users mailing list
> tmux-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/tmux-users


------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users

Reply via email to