GCC Compilation problem in HP LINUX server

gkarthi29 karthikeyan.gangatharan@lntinfotech.com
Tue Aug 4 10:48:00 GMT 2009


Hi

Compiling the following program 

#include <stdio.h>
int main()
{
        char **variable=NULL;

        printf("Starting\n");
        fflush(stdout);
        while(*variable)
        {
                printf("Inside while\n");
                fflush(stdout);
                break;
        }
        printf("Ending\n");
        fflush(stdout);
}

Produces the output 

Starting
Segmentation fault

My System configuration is,

Linux 2.6.9-55.0.2.ELsmp #1 SMP x86_64 x86_64 x86_64 GNU/Linux
gcc (GCC) 3.4.6 20060404 (Red Hat 3.4.6-8)

basically i need to dereference NULL pointer in the above code.Is there any
option available in Gcc? The above code works fine in a AIX server but not
in HP Linux server. 

Thanks
-- 
View this message in context: http://www.nabble.com/GCC-Compilation-problem-in-HP-LINUX-server-tp24806245p24806245.html
Sent from the gcc - Help mailing list archive at Nabble.com.



More information about the Gcc-help mailing list