>hi friends
>
>i want to know, how can i make my code "ANSI C" compatible.
If you mean a program that is 'Strictly conforming':
Read The Standard (Draft versions available from the links on the site
for this group [2] - you need to pay for the final versions) and adhere
to it. In particular, note behaviours that are Implementation-Defined,
Undefined, and Unspecified, and avoid them. Locale-Specific behaviour is
apparently allowed according to [1]
Don't use any headers that aren't described in that Standard.
Don't use any functions not described in that Standard which your
compiler maker supplies in the Standard headers.
Other things to bear in mind:
Turn up the warnings on your compiler. Make warnings 'errors.' Don't be
satisfied until your compiler emits nothing except a success on
compilation. If your compiler has a pedantic option, use it.
Understand that very few (if any) compilers are Standard in some of
their behaviour (MSVC with it's (non!)local for() loop variables in C++
for example.) Learn how/why your particular compiler isn't Standard and
don't use 'features' that aren't Standard or find workarounds to
behaviour that isn't Standard.
That's about it off the top of my head.
[1] http://www.lysator.liu.se/c/tc2.html
[2] http://groups.yahoo.com/group/c-prog/links/Standards_001012496381/
--
PJH
"...one of the main causes of the fall of the Roman Empire was that,
lacking zero, they had no way to indicate successful termination of
their C programs." - Robert Firth
Alderley plc, Arnolds Field Estate, The Downs, Wickwar, Gloucestershire, GL12 8JD, UK
Tel: +44(0)1454 294556 Fax: +44 (0)1454 299272
Website : www.alderley.com Sales : [EMAIL PROTECTED] Service : [EMAIL PROTECTED]
This email and its contents are confidential and are solely for the use of the intended recipient. If you are not the original recipient you have received it in error and any use, dissemination, forwarding, printing or copying of this email is strictly prohibited. Should you receive this email in error please immediately notify [EMAIL PROTECTED]
This email has been scanned for viruses, however you should always scan emails with your own systems prior to opening.
To unsubscribe, send a blank message to <mailto:[EMAIL PROTECTED]>.
| Yahoo! Groups Sponsor | |
|
|
Yahoo! Groups Links
- To visit your group on the web, go to:
http://groups.yahoo.com/group/c-prog/
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
