BUG: (0 && 1) == 1 (shows up in xmms with gcc 2.96)

kenneth topp caught@prodigy.net
Sat Jul 29 19:09:00 GMT 2000


Hello, 

Software: xmms v1.2.2 (current release)
Platform: redhat rawhide
Glibc: redhat's glibc-2.1.91-16

in xmms-1.2.2/xmms/input.c (line 326), there this code:
  
 if (ip->is_our_file(filename) && !g_list_find(disabled_iplugins,ip))
         break;

the ip->is_out_file(filename) evaluates to 0, but it evaluates
positively (ie: run's that break)

If I add a printf to that if block the code executes properly (although
slower).  if I use egcs-2.91.66, it also works properly.

Let me know if there are more details I can assist with (or if this is
known issue ;)

Kenneth Topp

btw - the result of this bug, is that xmms passes off to the wrong input
plugin to try to determine song name, and length.

-----------related function-----
void input_get_song_info(gchar * filename, gchar ** title, gint * length)
{
    GList *node;
    InputPlugin *ip = NULL;

    node = get_input_list();
    while (node)
    {
        ip = (InputPlugin *) node->data;
        if (ip->is_our_file(filename) && !g_list_find(disabled_iplugins, ip))
            break;
        node = node->next;
    }
    if (ip && node && ip->get_song_info)
        ip->get_song_info(filename, title, length);
    else
    {
        (*title) = NULL;
        (*length) = -1;
    }
}
--------------
compiled like:

gcc -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/lib/glib/include -D_REENTRANT
-I/usr/X11R6/include -O2 -march=i386 -mcpu=i686 -fomit-frame-pointer
-funroll-all-loops -finline-functions -ffast-math -m486
-DDATA_DIR=\"/usr/share/xmms\" -DPLUGIN_DIR=\"/usr/lib/xmms\"
-DPLUGINSUBS=\"Output\",\"Input\",\"Effect\",\"General\",\"Visualization\"
-DLOCALEDIR=\"/usr/share/locale\" -DI386_ASSEM -I../intl -O2 -march=i386
-mcpu=i686 -fomit-frame-pointer -funroll-all-loops -finline-functions
-ffast-math -m486 -c input.c



More information about the Gcc-bugs mailing list