473,399 Members | 2,774 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Standards for a FAR Pointer

===========
chat far * p;
delete (p);
===========

Can somebody let me know the behaviour of the above code (As per C
standards;irrespective of compiler implementations)

Sep 23 '06 #1
5 2304
In article <11**********************@i3g2000cwc.googlegroups. com>,
<sa*************@gmail.comwrote:
>===========
chat far * p;
delete (p);
===========
>Can somebody let me know the behaviour of the above code (As per C
standards;irrespective of compiler implementations)
There is no far pointers in the C standard.

There is also no delete() function in the C standard.
If you were to call free() on an uninitialized pointer, the result
would be undefined.

--
Prototypes are supertypes of their clones. -- maplesoft
Sep 23 '06 #2
Walter Roberson said:
In article <11**********************@i3g2000cwc.googlegroups. com>,
<sa*************@gmail.comwrote:
>>===========
chat far * p;
delete (p);
===========
>>Can somebody let me know the behaviour of the above code (As per C
standards;irrespective of compiler implementations)

There is no far pointers in the C standard.

There is also no delete() function in the C standard.
Furthermore, the language defines no chat type.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
Sep 23 '06 #3

<sa*************@gmail.comwrote in message
===========
chat far * p;
delete (p);
===========

Can somebody let me know the behaviour of the above code (As per C
standards;irrespective of compiler implementations)
In the bad old days Intel processors had what is known as segmented memory.
Whilst no doubt a great convenience to the electronics engineer, it was a
major nuisance tot he programmer. A segment was up to 64K, and to use blocks
of memory larger than that you had to do all sorts of fancy calculations.
This meant that the fancy calculations slowed down code, so to speed things
up a little PC compilers invented the "far" keyword. A far pointer was fancy
and slow, but could point to bigger regions of memory than normal pointers.

In modern times the far pointer is largely of historical interest only. If
you need to compile code with far pointer, sinple define "far" as a blank or
a comment.

delete is C++ and an extension of free. it is also a perfectly valid name
for a C function, but don't use it, unless you are one of those people who
think it makes a telling point to make your code a nuisance for C++
programmers to call and maintain.
--
www.personal.leeds.ac.uk/~bgy1mm
freeware games to download.
Sep 23 '06 #4
Richard Heathfield wrote:
Walter Roberson said:
> <sa*************@gmail.comwrote:
>>===========
chat far * p;
delete (p);
===========
>>Can somebody let me know the behaviour of the above code (As
per C standards;irrespective of compiler implementations)

There is no far pointers in the C standard.

There is also no delete() function in the C standard.

Furthermore, the language defines no chat type.
In addition the superequality operator =========== is a very rare
extension. Definitely not mentioned in the standard.

--
Some informative links:
news:news.announce.newusers
http://www.geocities.com/nnqweb/
http://www.catb.org/~esr/faqs/smart-questions.html
http://www.caliburn.nl/topposting.html
http://www.netmeister.org/news/learn2quote.html

Sep 23 '06 #5
>===========
>chat far * p;
delete (p);
===========

Can somebody let me know the behaviour of the above code (As per C
standards;irrespective of compiler implementations)
It shouldn't compile.
>In the bad old days Intel processors had what is known as segmented memory.
Whilst no doubt a great convenience to the electronics engineer, it was a
major nuisance tot he programmer. A segment was up to 64K, and to use blocks
of memory larger than that you had to do all sorts of fancy calculations.
Expect the issue to come back, when it gets uncomfortable to squeeze
programs into segments of only 4GB.
>This meant that the fancy calculations slowed down code, so to speed things
up a little PC compilers invented the "far" keyword. A far pointer was fancy
and slow, but could point to bigger regions of memory than normal pointers.
>In modern times the far pointer is largely of historical interest only. If
you need to compile code with far pointer, sinple define "far" as a blank or
a comment.
In modern times the so-called far pointer exists (as a 48-bit pointer
on Intel Pentium, for example) but is infrequently used as 4GB as
a limit isn't too constraining yet. There is no (good) reason to
make it a separate pointer type in C. You just use a compiler
implementation, often selected by a compiler command-line option,
that makes *ALL* pointers "far". Of course all the pieces of the
program have to be compiled the same way, but there are plenty of
options that have the same problem.

Sep 24 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Cameron Hatfield | last post by:
I was wondering how good this page of coding standards (http://www.doc.ic.ac.uk/lab/cplus/c++.rules/) is. Is it too outdated?
2
by: John Doe | last post by:
I have a webpage which shows and hides divs as a method of navigation. It works great in the ever evil IE. It works not so great (read not at all) in any standards compliant browser. I haven't...
13
by: Ian Tuomi | last post by:
Hello. I have been reading about all the different standards in C and I am quite confused, and have a few questions. () How is C99 "better" than older versions of C? (or is it?) What is the...
46
by: James Harris | last post by:
Before I embark on a new long-term project I'd appreciate your advice on how to split up long names. I would like to keep the standards for command names the same as that for variable names....
115
by: junky_fellow | last post by:
What is a C object ? If i have some function "func()" in my C program, then can i say that "func()" is a C object ? or if i have some function pointer (ptr) which contains the address of...
144
by: Natt Serrasalmus | last post by:
After years of operating without any coding standards whatsoever, the company that I recently started working for has decided that it might be a good idea to have some. I'm involved in this...
8
by: s.subbarayan | last post by:
Dear all, In one of our projects in a document about C coding standard it is stated as "Always check a pointer is NULL before calling free. Always set a free'd pointer to NULL to try to protect...
4
by: Richard G. Riley | last post by:
Gnu C has a feature for optimised branching using likely() and unlikely() for branch conditions e.g if(likely(f)){ ... or
13
by: Richard G. Riley | last post by:
In another thread it was pointed out that I'd made a booboo with strcpy : one that that I've, if I'm honest, made many times before. Not out of badness, just because since I first programmed C...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.