Skip to content

adding -Wall

6 messages · Paul Roebuck, Kasper Daniel Hansen, Seth Falcon +1 more

#
Hi

I am using the CRAN binary of R.

For package development I would like to compile with the -Wall flag.  
What is the best way to add this? Should I just edit
   R.Framework/Resources/ppc/etc/Makeconf
(I am on a G4), and add it to the CFLAGS, CXXFLAGS, FFLAGS variables.  
Or is there a better way, where I do not modify the files in the  
framework?

Btw: any reason why this is not enabled by default

Kasper
#
On Sun, 17 Dec 2006, Kasper Daniel Hansen wrote:

            
I'd leave the Framework Makeconf alone. It is not enabled
by default because GCC is not guaranteed to be the compiler
for CC.

I'd recommend adding it to PKG_CFLAGS, PKG_CXXFLAGS,
and/or PKG_FFLAGS in your package's Makevars file while
developing the package and remove it prior to release.
Be aware R CMD check will start giving you nonportable
warnings; live with it unless you really feel like going
the configure script route.

----------------------------------------------------------
SIGSIG -- signature too long (core dumped)
#
On Dec 17, 2006, at 12:35 PM, Paul Roebuck wrote:

            
I can understand that it is not enabled per default if I just  
configured R myself. But here we are talking about the CRAN binary.  
For that specific case I think it is reasonable to assume that a user  
will/should use the gcc shipping with the binary. There are other  
specific changes for the CRAN binary like the fact that the PATH  
variable is set.
Well, that is a solution. A bit irritating, if you are checking many  
packages, but reasonable I guess.
Eh? I don't get this.

Kasper
1 day later
#
Paul Roebuck <roebuck at mdanderson.org> writes:
? For the OSX _binary_, the compiler better be known in advance --
unless Simon et al are using some sort of quantum compiler ;-)

It is called Makeconf, afterall, so editing it seems sensible to me.
Changing PKG_* vars is inconvenient if you work on many packages, want
to see warnings in other people's packages, and work on many projects
at once since the probability of forgetting to fix it for a release is
non-zero.

My $0.02

+ seth
#
On Dec 18, 2006, at 10:14 AM, Seth Falcon wrote:

            
Probably the easiest [courtesy of Kurt]:

mkdir ~/.R
echo "CFLAGS=-g -O2 -Wall -pedantic" > ~/.R/Makevars
... sometimes I have the feeling we do ;) [especially after spending  
a night to track down compiler bugs]


Cheers,
Simon
#
Thanks for the help, I thought there would be some smart way of doing  
it... (I also sent by a private email to Paul by accident, which is  
superfluous now)

Kasper
On Dec 18, 2006, at 5:10 PM, Simon Urbanek wrote: