From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,d89ff62b8449f197 X-Google-Attributes: gid103376,public From: Huy Vo Subject: Re: Ada and robots Date: 1997/07/01 Message-ID: <199707012137.RAA06713@twins.ctron.com>#1/1 X-Deja-AN: 253939452 Sender: Ada programming language Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU Newsgroups: comp.lang.ada Date: 1997-07-01T00:00:00+00:00 List-Id: aebrain@dynamite.com.au (Alan Brain) wrote > >Huy Vo wrote: > >> I don't know a C compiler that doesn't have __LINE__. Do you? > >DEC LSI-11/02 C for RTS-11SJ. The first time I did an embedded system in >C, back in 1978. > >Turbo C++ 2.0 has problems with __LINE__ too, and I'll check with MVC++ >5 and CW 10, CW 12 to see if they give identical results. > >> Do you know of 2 compilers that will not agree on the value of __LINE__ >> in the following program: > >> #include /* since you insist on having this */ >> >> main() { >> printf("the value of __LINE__ is independent of the compiler %d\n", >> __LINE__); >> return 0; >> } > >Yes, the LSI-11/02 and Turbo C++ 2. > DEC has a compiler that accepts this line include stdio.h /* no brackets */ given the kind of liberty they allow the compiler to have, I wouldn't worry much what a DEC compiler has to say. I don't know where you digged out your copy of Turbo C; mine (Turbo C 4.5.1 ) compiles __LINE__ without a blink; if your compiler had problem with __LINE__ then it's a bug, and not a portability issue. The following compilers have __LINE__: Metaware Hi-C Sun cc and Sun acc gcc AIX xlc Microsoft 7.1 Mix Power C That's 7 modern compilers againts your ancient DEC compiler. I am sure the list is not exhaustive. If only 5 out of 10 Ada compilers provided an mechanism equivalent to __LINE__, would you forget the portability crap and use it, or are you still saying "Gee, I can't use this functionality because only half the compilers have it. I just have to hard code in the line number to make my code portable." IMHO, if there is a worse thing than goto then it has to be hard coded constants. You brought up the portability issue, whereas I intended to use __LINE__ solely as a method of debugging.