delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/09/07/09:16:11

From: Darren Johns <djohns AT csd DOT abdn DOT ac DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: gcc 2.7.2.1: Won't compile | or || symbols (really!)
Date: 07 Sep 1998 13:58:54 +0100
Organization: University of Aberdeen, Scotland
Lines: 50
Message-ID: <o2g1e413ld.fsf@csd.abdn.ac.uk>
References: <Pine DOT A32 DOT 3 DOT 91 DOT 980906022606 DOT 27528A-100000 AT broncho DOT ucok DOT edu> <1998090623100300 DOT TAA28060 AT ladder01 DOT news DOT aol DOT com>
NNTP-Posting-Host: trogon.csd.abdn.ac.uk
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

>Subject:	Re: gcc 2.7.2.1: Won't compile | or || symbols (really!)
>From:	JAU-BING LIN <jl1013 AT broncho DOT ucok DOT edu>
>Date:	Sun, 6 Sep 1998 02:33:54 -0500 (CDT)
>
>
>
>On Sat, 5 Sep 1998 richard AT wynne DOT demon DOT co DOT uk wrote:
>
>> Just installed gcc 2.7.2.1 (from djgpp distribution). Believe it or
>> not, I can't get logical or bitwise OR (pipe symbol) to compile. Get
>> message "parse error before character 0335", 335 being the (octal)
>> ascii for the pipe character. For example, this won't compile:
>> 
>> int main (int argc, char * argv[]) {
>>   if((argc == 1) || (argc == 2)) {
>>     return 1;
>>   } else {
>>     return o;
>>   }
>> }
>
>I guess the fllowing may work without using OR
>
> int main (int argc, char * argv[])
>  {
>   if (argc == 1)
>     return 1; 
>   else if (argc == 2)
>     return 1;
>   else
>     return 0;
> 
>  }

Without trying it this should work as well:

int main (int argc, char * argv[])
{
   return (argc == 1);
   return (argc == 2)
   return 0;
}

/Darren. 
-- 
| To take no action is in itself taking an action, and to have no opinion is |
|/-\| to have an opinion, so are we helpless in what goes on around us?? |/-\|
|\-/|\-/|\-/|\-  D Mark Johns.   mailto:djohns AT csd DOT abdn DOT ac DOT uk  -/|\-/|\-/|\-/|
|_____________________ http://www.csd.abdn.ac.uk/~djohns ____________________|

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019