TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: PAUL EDWARDS
from: Bruce Simpson
date: 1994-06-22 08:33:38
subject: C/C++ Compiler

PE> SS>> Is CSet++ 100% ANSI C compatible?  I'm careful to use
ANSI C functions
PE> SS>> as

PE> PF> Yes,  even more so than Borland in my experience.  I too am mainly a C
PE> PF> programmer.

PE>Please name the things that Borland isn't 100% ANSI C compatible in.  I only

I may be wrong here (not unusual) but I believe that ANSI recommends
that non-ANSI standard-library routines names should start with an
underscore.

CSet++ supports this by using the following names for common (but not
ANSI) functions:

        BORLAND          ANSI recommendation (IBM CSet++)

        open                        _open
        close                       _close
        read                        _read
        write                       _write

There are more, these are just a few examples.

Now this is not *manditory* under the ANSI standard but it is
recommended so I guess that's why IBM's CSet++ has used the recommended
naming techniques.  Borland (and MS) have chosen to use the older (still
valid for POSIX libraries) naming convention.

I see that MS uses this recommendation for its _dos* functions but uses
the older (open,close) naming for other non-ANSI std-library functions.

This means of course that even if your code is 100% ANSI compliant it
may still fail to compile without change on another machine if you've
used non-ANSI library functions and ANSI doesn't seem to provide much in
the way of support for shared-file operations which are becoming so
commonplace in multi-tasking/multi-user environments.

Note: Watcom's (ANSI compliant) compiler also uses the POSIX conformant
naming conventions but I *always* use a header file which #define's the
POSIX names to the ANSI recommended form, eg:

#define  _open  open
#define  _close close

That way my code conforms to both the ANSI standard *and* the ANSI
recommendations.

--- Enigmax v1.04a

* Origin: === Enigma BBS, Akld, NZ. +64 9 480-0951 === (3:772/350)
SEEN-BY: 54/54 620/243 622/407 623/630 632/339 348 640/715 820 670/215
SEEN-BY: 690/347 660 700/31 711/409 413 430 807 808 809 934 712/353 414 623
SEEN-BY: 713/888 770/115 771/1320 772/1 20 140 207 350 380 440 1000 774/605
SEEN-BY: 800/1 2442/0
@PATH: 772/350 20 712/353 711/409 54/54 711/808 809 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.