[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-cygwin
Subject:    Defaul-NULL pointer Error
From:       Peter_Kümmel <syntheticpp () gmx ! net>
Date:       2005-01-09 12:18:32
Message-ID: 41E12118.6010902 () gmx ! net
[Download RAW message or body]

Hello,

yesterday I've fixed a error in QPrinter::setup(QWidget* parent = 0)
which originates in usage of a default-NULL pointer.
Maybe there are more such bugs in our code.
The structure of the bug looks like the following example code:


struct TT{
     int d;
};

int ttt( TT* t = 0){
     return  t->d;
}

int main( int argc, char** argv )
{
     int i = ttt(); // <- Segmentation fault
     return 0;
}


I think this bug could be found by a compiler. Does anybody know
a compiler warning  or compiler which detects such bugs?
(g++ -Wall does not help)

Peter



_______________________________________________
kde-cygwin mailing list
kde-cygwin@kde.org
https://mail.kde.org/mailman/listinfo/kde-cygwin
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic