Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Arithmetic on function address

Reply
Thread Tools

Arithmetic on function address

 
 
Richard Bos
Guest
Posts: n/a
 
      06-01-2010
Stargazer <> wrote:

> Note that conversion of integer constant to a pointer is explicitly
> defined to result in an address constant - and according to 6.3.2.3.5
> it may not cause undefined behavior.


Actually, in a practical sense it may, unless the value is immediately
discarded (which would make the entire conversion useless). It can
result in incorrectly aligned or trap pointers, any use of which do have
undefined behaviour.

Richard
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Address Arithmetic aistone@gmail.com C++ 14 07-10-2006 12:03 AM
Address of array behavior in pointer arithmetic joshc C Programming 16 06-15-2006 10:14 PM
A kind of arithmetic for subnetting and ip address management lily Cisco 0 05-08-2006 09:32 AM
Usual Arithmetic Conversions-arithmetic expressions joshc C Programming 5 03-31-2005 02:23 AM
Arithmetic on function address Stephen Biggs C Programming 21 04-28-2004 11:17 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57