Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > NOP pointer

Reply
Thread Tools

NOP pointer

 
 
TefJlives
Guest
Posts: n/a
 
      03-12-2007
Can someone please expain what is a NOP pointer, or give a good link?
Thanks.

Greg

 
Reply With Quote
 
 
 
 
Ben Pfaff
Guest
Posts: n/a
 
      03-12-2007
"TefJlives" <> writes:

> Can someone please expain what is a NOP pointer, or give a good link?


Do you mean a "null pointer"? A null pointer is a pointer that
has been assigned a null pointer constant. The C99 standard
defines it like this:

3 An integer constant expression with the value 0, or such an
expression cast to type void *, is called a null pointer
constant.55) If a null pointer constant is converted to a
pointer type, the resulting pointer, called a null pointer,
is guaranteed to compare unequal to a pointer to any object
or function.

--
"It wouldn't be a new C standard if it didn't give a
new meaning to the word `static'."
--Peter Seebach on C99
 
Reply With Quote
 
 
 
 
Keith Thompson
Guest
Posts: n/a
 
      03-12-2007
"TefJlives" <> writes:
> Can someone please expain what is a NOP pointer, or give a good link?
> Thanks.


As far as I know, there's no such thing.

If you're asking about null pointers, see section 5 of the comp.lang.c
FAQ, <http://www.c-faq.com/>.

--
Keith Thompson (The_Other_Keith) kst- <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
 
Reply With Quote
 
Malcolm McLean
Guest
Posts: n/a
 
      03-12-2007

"TefJlives" <> wrote in message
news: oups.com...
> Can someone please expain what is a NOP pointer, or give a good link?
> Thanks.
>

Not a clue.
Normally NOP refer to "no operation". So a function pointer that pointed to
an empty function might be what you are after.
For instance, say you are calling code written back in the 386 days which
used to take a minute to execute. So the caller provided a callback so you
could spin a line or update a progress bar. Now with your dual core Pentium
IV it takes less than a tenth of a second to execute, so the callback is no
longer useful. However you still need to provide something to call, so a
pointer to an empty function would be appropriate.

--
Free games and programming goodies.
http://www.personal.leeds.ac.uk/~bgy1mm


 
Reply With Quote
 
Keith Thompson
Guest
Posts: n/a
 
      03-12-2007
Ben Pfaff <> writes:
> "TefJlives" <> writes:
>> Can someone please expain what is a NOP pointer, or give a good link?

>
> Do you mean a "null pointer"? A null pointer is a pointer that
> has been assigned a null pointer constant. The C99 standard
> defines it like this:

[snip]

Assigning a null pointer constant is only one way to produce a null
pointer. (The standard's definition is unclear on this point.)

--
Keith Thompson (The_Other_Keith) kst- <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
 
Reply With Quote
 
CBFalconer
Guest
Posts: n/a
 
      03-12-2007
TefJlives wrote:
>
> Can someone please expain what is a NOP pointer, or give a good link?


No such beast in the C language.

--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net>


--
Posted via a free Usenet account from http://www.teranews.com

 
Reply With Quote
 
TefJlives
Guest
Posts: n/a
 
      03-13-2007
On Mar 12, 4:53 pm, CBFalconer <cbfalco...@yahoo.com> wrote:
> TefJlives wrote:
>
> > Can someone please expain what is a NOP pointer, or give a good link?

>
> No such beast in the C language.
>
> --
> Chuck F (cbfalconer at maineline dot net)
> Available for consulting/temporary embedded and systems.
> <http://cbfalconer.home.att.net>
>
> --
> Posted via a free Usenet account fromhttp://www.teranews.com


Thanks for all your replies. I was under a misunderstanding. I was
looking for a no-op command, but I thought it was some kind of
pointer. Which is why I couldn't find anything about it on the web.

Greg

 
Reply With Quote
 
Keith Thompson
Guest
Posts: n/a
 
      03-13-2007
"TefJlives" <> writes:
> On Mar 12, 4:53 pm, CBFalconer <cbfalco...@yahoo.com> wrote:
>> TefJlives wrote:
>>
>> > Can someone please expain what is a NOP pointer, or give a good link?

>>
>> No such beast in the C language.


Please don't quote signatures.

> Thanks for all your replies. I was under a misunderstanding. I was
> looking for a no-op command, but I thought it was some kind of
> pointer. Which is why I couldn't find anything about it on the web.


It sounds like you're looking for a null statement, which looks like
this:

;

Or you can use an empty compound statement:

{ }

What are you trying to do?

--
Keith Thompson (The_Other_Keith) kst- <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
 
Reply With Quote
 
Richard Bos
Guest
Posts: n/a
 
      03-13-2007
"TefJlives" <> wrote:

> Can someone please expain what is a NOP pointer, or give a good link?


A NOP pointer is a roadsign to the polder where I live.

HTH; HAND.

Richard
 
Reply With Quote
 
santosh
Guest
Posts: n/a
 
      03-13-2007
TefJlives wrote:
> On Mar 12, 4:53 pm, CBFalconer <cbfalco...@yahoo.com> wrote:
> > TefJlives wrote:
> >
> > > Can someone please expain what is a NOP pointer, or give a good link?

> >
> > No such beast in the C language.

>
> Thanks for all your replies. I was under a misunderstanding. I was
> looking for a no-op command, but I thought it was some kind of
> pointer. Which is why I couldn't find anything about it on the web.


The closest C comes to a NOP command is a null statement: a semicolon
all by itself. A self assignment may also qualify:

x = x;

The compiler will likely optimise both of them away, which is why they
can't really be considered as equivalent of an assembly language NOP.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is memcpy with len=0 a NOP? Noob C Programming 16 02-03-2011 08:40 AM
howto overload with a NOP (empty statement) Stef Mientki Python 5 01-06-2007 02:34 PM
passing the address of a pointer to a func that doesnt recieve a pointer-to-a-pointer jimjim C Programming 16 03-27-2006 11:03 PM
Pointer-to-pointer-to-pointer question masood.iqbal@lycos.com C Programming 10 02-04-2005 02:57 AM
_asm NOP : undeclared identifier Saurabh Aggrawal C++ 3 12-10-2004 01:43 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57