David Pagan's Weblog

     
 
Tip on xcheck=init_local for those who may not know ...

 

So, speaking of the new flag in Sun Studio 12,  -W0,-xcheck=init_local. As I was trying it out recently, giving it a spin, I noticed that I wasn't getting any floating point traps, even though I was using the init_local flag as described and knew I was using a floating point variable in a computation before it was assigned a legitimate value. I was perplexed, but only for a moment :-)

You see, as I had barreled ahead in trying things out, I'd completely forgotten that traps are turned off by default in Sun Studio C. In appendix B, section 2.28, you can see that the default for -ftrap is -ftrap=%none. Accordingly, the traps I was expecting just weren't going to happen. A simple addition of -ftrap=common on the command line, however, and I saw the expected traps. Nice!

A useful little thing to remember if using this flag to help debug your program ... 

Posted by dpagan @ 05:10 PM PDT [ Comments [1] ]
 
 
 
 
Trackback URL: http://blogs.sun.com/dpagan/entry/tip_on_xcheck_init_local
Comments:

Like to do it

Posted by free pictures on June 22, 2007 at 05:51 PM PDT #

Post a Comment:

Name:
E-Mail:
URL:

Your Comment:

HTML Syntax: NOT allowed
 
« November 2009
SunMonTueWedThuFriSat
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
     
       
Today

[RSS Newsfeed]

Valid XHTML or CSS?

[This is a Roller site]
Theme by Rowell Sotto.
 
© David Pagan's Weblog