Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site gatech.CSNET Path: utzoo!watmath!clyde!bonnie!akgua!gatech!jeff From: jeff@gatech.CSNET (Jeff Lee) Newsgroups: net.lang.c Subject: Pointer Trouble Right Here in Unix City Message-ID: <179@gatech.CSNET> Date: Tue, 28-May-85 13:35:30 EDT Article-I.D.: gatech.179 Posted: Tue May 28 13:35:30 1985 Date-Received: Thu, 30-May-85 03:04:31 EDT Distribution: net Organization: School of ICS, Georgia Institute of Technology, Atlanta Lines: 41 I was in the process of writing a section of code that parsed arguments (how many times have you re-invented the wheel) and came across a problem that I think is bug in the C compiler, but before I become so bold to call it that, I want to get other peoples opinions. The problem is to allow either "-parg" or "-p arg". After fooling with it a few minutes, I came up with this (just the relevent section is enclosed) if (**argv != '-') usage(); switch (*(*argv + 1)) { case 'd': *(*argv + 2) ? *argv += 2 : argv++; /* other processing goes here */ break; case 'b': *(*argv + 2) ? *argv += 2 : argv++; /* other processing goes here */ . . . The problem is that I get the error messages warning: illegal pointer combination illegal types in : when I compile it. I am turning it into if/else combinations, but it sort of ruins the nice looking single line phrase that doesn't get in your way. What is wrong with this ?? It happens under BRL's Berkeley 4.2 and under their system V emulation. Tell me, is it me, or is it Memorex ?? -- Jeff Lee CSNet: Jeff @ GATech ARPA: Jeff%GATech.CSNet @ CSNet-Relay.ARPA uucp: ...!{akgua,allegra,hplabs,ihnp4,linus,seismo,ulysses}!gatech!jeff