This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the EGCS project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Incorrect `might be used uninitialized' message


/* Demonstrates bug in egcs-2.91.66 on FreeBSD 3.2.  To see the bug,
   compile using:
   
          gcc -c token.c -g -Wall -O2 

   The bug is the warning:

     token.c:17: warning: `c' might be used uninitialized in this function

   egcs-2.91.60 on Solaris 2.6 reports this message twice.
*/


extern int getch();
extern int class();

int
token()
{
    int state = 1;

    while (1) {
	int c=0;
	c = getch();
	switch (state) {
	case 1: break;
	case 4: break;
	case 5: break;
	case 6: 
            {
	        switch (class(c)) {
	        default: break;
	        }
	    } break;
	case 7:	break;
	}
    }
}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]