Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!tut.cis.ohio-state.edu!cs.utexas.edu!uwm.edu!uakari.primate.wisc.edu!ark1!nems!mimsy!lint@mimsy.umd.edu From: lint@mimsy.umd.edu (The Lint Program) Newsgroups: comp.lang.c Subject: Re: What is wrong with this code ? Message-ID: <21198@mimsy.umd.edu> Date: 10 Dec 89 16:20:36 GMT References: <1156@nsscb.UUCP> Sender: chris@mimsy.umd.edu Reply-To: brandy@mimsy.umd.edu Lines: 32 In article <1156@nsscb.UUCP> nrg@nsscb.UUCP (G.Narotham Reddy) writes: main(argc,argv) int argc; char *argv[]; { struct stat nfile; stat(argv[1], &nfile); if (nfile.st_mode & S_IFMT == S_IFREG) printf("%s regular file\n", argv[1]); else if (nfile.st_mode & S_IFMT == S_IEXEC) printf("%s executable\n", argv[1]); else if (nfile.st_mode & S_IFMT == S_IWRITE) printf("%s writable\n", argv[1]); else if (nfile.st_mode & S_IFMT == S_IREAD) printf("%s readable\n", argv[1]); else if (nfile.st_mode & S_IFMT == S_IFDIR) printf("%s dir\n", argv[1]); } t.c(11): warning: constant in conditional context t.c(11): warning: null effect t.c(13): warning: constant in conditional context t.c(13): warning: null effect t.c(15): warning: constant in conditional context t.c(15): warning: null effect t.c(17): warning: constant in conditional context t.c(17): warning: null effect t.c(19): warning: constant in conditional context t.c(19): warning: null effect t.c(6): warning: argument argc unused in function main stat returns value which is always ignored printf returns value which is always ignored