[R-SIG-Mac] warnings on windows but not on mac os

Prof Brian Ripley ripley at stats.ox.ac.uk
Sun Aug 17 14:36:32 CEST 2008


Compile C with -Wall (or even -Wall -pedantic).

You also need to sort out your use of 'inline': as I recall the Apple gcc 
has C99 semantics turned on when it is not on in the released FSF versions 
of gcc (4.3 or later).  This makes testing rather tricky (but see the R 
sources for what works for us, especially Rinlinedfunctions.h).

On Sun, 17 Aug 2008, Christophe Dutang wrote:

> Hi,
>
> Before sending new version of randtoolbox on CRAN, I'll try to test it on 
> different OS, namely windows xp, than mac os x. When building the package 
> which includes C code, I get no warnings on my macbook (mac os leopard) but 
> warnings appeared on my pc (windows xp home).
>
> Do you have any idea why I get the following warnings?
>
> warning: "/*" within comment
> warning: no newline at end of file
> warning: unused variable 'rest'
>
> Does I need to do something on my mac to get those warnings?
>
> Thanks in advance
>
> Kind regards
>
> Christophe
>
> PS : partial "log"
>
> R CMD install randtoolbox_1.03.tar.gz
> installing to 'c:/PROGRA~1/R/R-27~1.1/library'
>
>
> ---------- Making package randtoolbox ------------
> adding build stamp to DESCRIPTION
> installing NAMESPACE file and metadata
> making DLL ...
> making SFMT.d from SFMT.c
> making WELL1024a.d from WELL1024a.c
> making WELL19937a.d from WELL19937a.c
> making WELL44497a.d from WELL44497a.c
> making WELL512a.d from WELL512a.c
> making init.d from init.c
> making randtoolbox.d from randtoolbox.c
> making testrng.d from testrng.c
> gcc  -std=gnu99  -IC:/PROGRA~1/R/R-27~1.1/include     -O3 -Wall  -c SFMT.c -o 
> SF
> MT.o
> SFMT.c:105:1: warning: "/*" within comment
> SFMT.c:108:1: warning: "/*" within comment
> SFMT.c:111:2: warning: "/*" within comment
> SFMT.c:894:1: warning: "/*" within comment
>
> [removed]
>
> o WELL512a.o
> gcc  -std=gnu99  -IC:/PROGRA~1/R/R-27~1.1/include     -O3 -Wall  -c init.c -o 
> in
> it.o
> In file included from randtoolbox.h:37,
>                from init.c:31:
> WELL19937a.h:12:35: warning: no newline at end of file
> In file included from randtoolbox.h:38,
>                from init.c:31:
> WELL44497a.h:12:42: warning: no newline at end of file
> randtoolbox.h:63: warning: 'fracPart' declared 'static' but never defined
> gcc  -std=gnu99  -IC:/PROGRA~1/R/R-27~1.1/include     -O3 -Wall  -c 
> randtoolbox.
> c -o randtoolbox.o
> In file included from randtoolbox.h:37,
>                from randtoolbox.c:29:
> WELL19937a.h:12:35: warning: no newline at end of file
> In file included from randtoolbox.h:38,
>                from randtoolbox.c:29:
> WELL44497a.h:12:42: warning: no newline at end of file
> randtoolbox.c:153: warning: C99 inline functions are not supported; using 
> GNU89
> randtoolbox.c:153: warning: to disable this warning use -fgnu89-inline or the 
> gn
> u_inline function attribute
> randtoolbox.c: In function 'SFmersennetwister':
> randtoolbox.c:282: warning: unused variable 'rest'
> randtoolbox.c:280: warning: unused variable 'nbblock'
> randtoolbox.c: In function 'randSeed':
> randtoolbox.c:547: warning: suggest parentheses around arithmetic in operand 
> of
> ^
> randtoolbox.c: In function 'randSeedByArray':
> randtoolbox.c:570: warning: unused variable 'temp'
> gcc  -std=gnu99  -IC:/PROGRA~1/R/R-27~1.1/include     -O3 -Wall  -c testrng.c 
> -o
> testrng.o
> windres --preprocessor="gcc -E -xc -DRC_INVOKED" -I 
> C:/PROGRA~1/R/R-27~1.1/inclu
> de  -i randtoolbox_res.rc -o randtoolbox_res.o
> gcc  -std=gnu99  -shared -s  -o randtoolbox.dll randtoolbox.def SFMT.o 
> WELL1024a
> .o WELL19937a.o WELL44497a.o WELL512a.o init.o randtoolbox.o testrng.o 
> randtoolb
> ox_res.o  -LC:/PROGRA~1/R/R-27~1.1/bin    -lR
> ... DLL made
> installing DLL
>
> [removed]
>
> * DONE (randtoolbox)
>
> _______________________________________________
> R-SIG-Mac mailing list
> R-SIG-Mac at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-SIG-Mac mailing list