Mailinglist Archive: yast-devel (132 mails)

< Previous Next >
[yast-devel] warning: suggest parentheses around ...
  • From: Martin Vidner <mvidner@xxxxxxx>
  • Date: Mon, 8 Oct 2007 10:47:35 +0200
  • Message-id: <20071008084735.GB22687@xxxxxxxxxxxxxxxx>
Hi hackers,

with GCC 4.3, you may have seen these new* warnings.
I suggest that you pay attention to them, as I have just found a
long standing bug thanks to them.

Can you spot it? :-)
http://svn.opensuse.org/svn/yast/trunk/core/wfm/src/Y2CCWFM.cc
Y2CCWFM::createInLevel

        if (strlen(name) > 4 && !strcmp(name + strlen(name) - 4, ".ycp"))
            try_it = true;
        else {
            struct stat buf;
            if (0 == stat(name, &buf))
            {
                // Try it, if it is not executable
                if (S_ISREG(buf.st_mode) && buf.st_mode & S_IXOTH != S_IXOTH)
                    try_it = true;
            }
        }
        if (!try_it) return 0;

Use:
RPMNAME=yast2-core; less /work/built/dists/all/beta-i386/packs-i386/$RPMNAME/$RPMNAME-*/Logfile*

*) Well the warning is not actually new, but before 4.3 it only worked
for gcc, not g++.
-- 
Martin Vidner, YaST developer
http://en.opensuse.org/User:Mvidner

Kuracke oddeleni v restauraci je jako fekalni oddeleni v bazenu
-- 
To unsubscribe, e-mail: yast-devel+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-devel+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages