GCC Compilation problem in HP LINUX server

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux