[Rd] operation on ‘numsels’ may be undefined

cstrato cstrato at aon.at
Mon Jun 23 15:20:12 CEST 2014

Dear all,

Since many years the following C++ code does compile on ALL Bioconductor 
servers (Linux, Windows, Mac) without any warnings:

    Int_t numsels = 0;  //number of selected entries
    for (Int_t i=0; i<size; i++) {
       numsels = (arrMask[i] == 1) ? ++numsels : numsels;

Even on the recently added release server 'zin2' Linux (Ubuntu 12.04.4 
LTS) the above code compiles w/o warnings.

However, on the new development server 'zin1' Linux (Ubuntu 12.04.4 LTS) 
I get suddenly the following warning message:

Found the following significant warnings:
   XPSPreProcessing.cxx:3026:56: warning: operation on ‘numsels’ may be 
undefined [-Wsequence-point]

Interestingly, both servers do not only run the same version of Ubuntu, 
but also the same version of the C++ compiler, i.e. g++ (Ubuntu/Linaro 
4.6.3-1ubuntu5) 4.6.3, and use the same flags, see:

My question is now, why do I suddenly get the compiler warning?

The reason why I ask at R-devel and not Bioc-devel is that it may not 
only be a Bioc question, since I found the following links:

I am not sure if I understand the meaning, but until now I have never 
got any warning from any compiler the I have used (including MS Visual 

Do I really have to replace '++numsels' with 'numsels+1'?

Best regards,
C.h.r.i.s.t.i.a.n   S.t.r.a.t.o.w.a
V.i.e.n.n.a           A.u.s.t.r.i.a
e.m.a.i.l:        cstrato at aon.at

More information about the R-devel mailing list