GCC sucks

Published at Mon 26, 2007 20:20 | Permalink Permalink | Comments Comments (0) | Trackbacks Trackbacks (0)

I spent most of my day working on my CShare project.

Somewhere in the middle of the afternoon I’ve started having a problem: GCC keeps saying to me that a variable is unused. The code with the problem follows:

gint cshare_send(gchar *path, GIOChannel *channel) {
    gint ok = 0;
    struct stat file_info;
    (...)

    if(!access(path, R_OK)) {
        /* path is a file */
        if(g_file_test(path, G_FILE_TEST_IS_REGULAR)) {struct stat file_info;
            g_stat(path, &file_info);
            ok = cshare_send_file(path, file_info.st_size, channel);
        }
       (...)

The variable unused was file_info. I needed almost 1 hour to figure out the problem… Shame on me… Maybe you can do best :)

About

photo of Ruben Fonseca

My name is Ruben Fonseca. I'm a Computer Science and Systems Engineer from Portugal that loves FLOSS.

I'm currently an Open Source Consultant at Lisbon, Portugal. This blog is about my daily geek life.

You can contact me anytime at or via LinkedIn:

View Ruben Fonseca's profile on LinkedIn

Feeds

Related Posts

You may be interested in these posts too:

0 Comments | rss | atom | xml | json

new comment New Comment