Re: variadic null ptr
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > Re: variadic null ptr




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Re: variadic null ptr  
Erik Max Francis


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
05-20-07 12:17 AM

Bjorn Reese wrote:

> That is a good question. According to my reading of C99, char and float
> are not compatible [6.2.7] even after default argument promotion, so
> char * and float * are not compatible either [6.7.5.1/2, 6.2.5/27].
> Getting an incompatible pointer with va_arg() invokes undefined behavior
> [6.5.2.2/6].
>
> Another way to look at it is that void * and char * are required to have
> the same representation and alignment, but char * and float * are not
> [6.2.5/17].

You are correct.  The explicit cast is required.

--
Erik Max Francis && max@alcyone.com && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM, Y!M erikmaxfrancis
And your daddy died for you / And I'll do the same
-- India Arie





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 05:13 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register