Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

level of questions for experts only

0 views
Skip to first unread message

ROSY

unread,
Sep 25, 2003, 11:15:22 PM9/25/03
to
hello,
response if u ,on all level of questions:::
1.how a self deletable .exe file deleted on some future date & time
without
invoking the .exe itself?
2.if we want that any wildcard characters in command line arguments
should be appropriately expanded,are we reqd. 2 make any special
provision?if yes,which?
3.why :: printf("%%%%%") ; output %%%.
4.how 2 run a .obj file without previously creating any .exe?
5.what is classical class?(FOR C++)

bye,

Tom Zych

unread,
Sep 25, 2003, 11:44:12 PM9/25/03
to
ROSY wrote:

> response if u ,on all level of questions:::

This means what, in English?

> 1.how a self deletable .exe file deleted on some future date & time
> without
> invoking the .exe itself?
> 2.if we want that any wildcard characters in command line arguments
> should be appropriately expanded,are we reqd. 2 make any special
> provision?if yes,which?
> 3.why :: printf("%%%%%") ; output %%%.
> 4.how 2 run a .obj file without previously creating any .exe?
> 5.what is classical class?(FOR C++)

Wow, not only for experts, but mostly for experts in other
newsgroups ;)

1, 2: Platform-specific; ask on a group for your platform.
4: Also platform-specific, but it sounds like you want to run
something that hasn't been linked, which I suspect can't be done.
5: You seem to be aware that this is a C++ question. Are you aware
that you asked it in comp.lang.c? We don't do C++ here.

3: '%' in the first argument to printf() starts a format specifier.
"%%" is the format specifier that means "print '%'". Apparently the
last one, being by itself at the end, also prints '%'; I don't know
if that's standard or just what your implementation does.

--
Tom Zych
This is a fake email address to thwart spammers.
Real address: echo 'gbz...@cbobk.pbz' | rot13

Mike Wahler

unread,
Sep 26, 2003, 2:15:31 AM9/26/03
to
"ROSY" <debashis...@rediffmail.com> wrote in message
news:730a1617.03092...@posting.google.com...

> hello,
> response if u ,on all level of questions:::
> 1.how a self deletable .exe file deleted on some future date & time
> without
> invoking the .exe itself?

Not a question about C.

> 2.if we want that any wildcard characters in command line arguments
> should be appropriately expanded,are we reqd. 2 make any special
> provision?

Yes.

>if yes,which?

Decide what you want each pattern to mean, and parse
accordingly.

> 3.why :: printf("%%%%%") ; output %%%.

Look up 'escape sequence' in a C book.

> 4.how 2 run a .obj file without previously creating any .exe?

Not a question about C.

> 5.what is classical class?(FOR C++)

Not a question about C. Nor does C++ have anything
called a 'classical class'.

>
> bye,

Here's a question for you: Where's your textbook?

-Mike


Mike Wahler

unread,
Sep 26, 2003, 2:17:31 AM9/26/03
to

"Mike Wahler" <mkwa...@mkwahler.net> wrote in message
news:7QQcb.4714$NX3....@newsread3.news.pas.earthlink.net...

> > 3.why :: printf("%%%%%") ; output %%%.
>
> Look up 'escape sequence' in a C book.

Sorry, not 'escape sequence', but 'format specifiers'
for 'printf()' function.

-Mike


Irrwahn Grausewitz

unread,
Sep 26, 2003, 6:39:40 AM9/26/03
to
Tom Zych <tzno...@pobox.com> wrote:

>ROSY wrote:
<SNIP>


>> 3.why :: printf("%%%%%") ; output %%%.
>

>3: '%' in the first argument to printf() starts a format specifier.
>"%%" is the format specifier that means "print '%'". Apparently the
>last one, being by itself at the end, also prints '%'; I don't know
>if that's standard or just what your implementation does.

IMO printf("%"); invokes undefined behaviour because it
consits of an invalid conversion specification, according
to ISO/IEC 9899:1999 7.19.6.1#9.

Regards

Irrwahn
--
ERROR 103: Dead mouse in hard drive.

goose

unread,
Sep 26, 2003, 8:18:21 AM9/26/03
to
debashis...@rediffmail.com (ROSY) wrote in message news:<730a1617.03092...@posting.google.com>...

> hello,
> response if u ,on all level of questions:::

idiot!!!

> 1.how a self deletable .exe file deleted on some future date & time
> without
> invoking the .exe itself?
> 2.if we want that any wildcard characters in command line arguments
> should be appropriately expanded,are we reqd. 2 make any special
> provision?if yes,which?
> 3.why :: printf("%%%%%") ; output %%%.
> 4.how 2 run a .obj file without previously creating any .exe?
> 5.what is classical class?(FOR C++)
>

by now you should have realised that no one in this
group will do your homework for you. trying to engage
them with "expert" questions only further enrages the
regulars.

goose,
did you even read the faq for clc yet ?

Joona I Palaste

unread,
Sep 26, 2003, 8:27:57 AM9/26/03
to
goose <ru...@webmail.co.za> scribbled the following:

> debashis...@rediffmail.com (ROSY) wrote in message news:<730a1617.03092...@posting.google.com>...
>> hello,
>> response if u ,on all level of questions:::

> idiot!!!

Seconded. You (ROSY) should also invest in a readable writing style and
not h4x0r d00d l33tsp33k like this.
I'll rewrite your questions like they would have been posed by a sane
person.

Hello, respond if you are on all level of questions.

>> 1.how a self deletable .exe file deleted on some future date & time
>> without
>> invoking the .exe itself?

How can a self-deletable .exe file delete itself on some future date
and time without invoking the .exe file itself?

>> 2.if we want that any wildcard characters in command line arguments
>> should be appropriately expanded,are we reqd. 2 make any special
>> provision?if yes,which?

If we want any wildcard characters in command line arguments to be
appropriately expanded, are we required to make any special provision?
If yes, which?

>> 3.why :: printf("%%%%%") ; output %%%.

Why printf("%%%%%"); outputs %%%?

>> 4.how 2 run a .obj file without previously creating any .exe?

How to run a .obj file without previously creating any .exe file?

>> 5.what is classical class?(FOR C++)

What is a classical class? (For C++)

Most important rules:
1) It's "you". Y-O-U. "U" is not a pronoun, it's a letter. Furthermore,
"ur" is a German prefix. In English we write "your" or "you're". No
points deducted for confusing the two, native speakers also often do.
2) Numbers are numbers, words are words, and never the twain shall
meet. "Words" like "2" for "to" and "4" for "four" belong to 12-year-
old script kiddies.
3) Use proper capitalisation. The first letter of the first word of
a sentence should be capitalised. In other words, do not write like
e.e.cummings.
4) Question sentences should end in a question mark. ONE question
mark. Not like "can U help me plz?????????????????????????????????????".
Yes, you guessed it, "plz" is also out. Write "please". And on the off
chance you should ever receive a real answer (which would require a
real question in the first place), say "thanks", not "thx".

That should cover the most of the lot.

--
/-- Joona Palaste (pal...@cc.helsinki.fi) ---------------------------\
| Kingpriest of "The Flying Lemon Tree" G++ FR FW+ M- #108 D+ ADA N+++|
| http://www.helsinki.fi/~palaste W++ B OP+ |
\----------------------------------------- Finland rules! ------------/
"Shh! The maestro is decomposing!"
- Gary Larson

Joona I Palaste

unread,
Sep 26, 2003, 8:35:18 AM9/26/03
to
Joona I Palaste <pal...@cc.helsinki.fi> scribbled the following:

> 2) Numbers are numbers, words are words, and never the twain shall
> meet. "Words" like "2" for "to" and "4" for "four" belong to 12-year-
> old script kiddies.

That should be "4" for "for", natch.

--
/-- Joona Palaste (pal...@cc.helsinki.fi) ---------------------------\
| Kingpriest of "The Flying Lemon Tree" G++ FR FW+ M- #108 D+ ADA N+++|
| http://www.helsinki.fi/~palaste W++ B OP+ |
\----------------------------------------- Finland rules! ------------/

"You will be given the plague."
- Montgomery Burns

Dan Pop

unread,
Sep 26, 2003, 9:54:38 AM9/26/03
to
In <7QQcb.4714$NX3....@newsread3.news.pas.earthlink.net> "Mike Wahler" <mkwa...@mkwahler.net> writes:

>"ROSY" <debashis...@rediffmail.com> wrote in message
>news:730a1617.03092...@posting.google.com...
>

>> 3.why :: printf("%%%%%") ; output %%%.
>
>Look up 'escape sequence' in a C book.

Huh?!? Can't see any escape sequence in this format string. And the
effect of the 5th '%' sign can't be explained by any C book, being
undefined.

Dan
--
Dan Pop
DESY Zeuthen, RZ group
Email: Dan...@ifh.de

John Bode

unread,
Sep 26, 2003, 10:15:51 AM9/26/03
to
> hello,
> response if u ,on all level of questions:::
> 1.how a self deletable .exe file deleted on some future date & time
> without
> invoking the .exe itself?

This is not a question about the C programming language.

Let me get this straight. You have an executable that deletes itself.
You want this executable to delete itself at some future time, but
without invoking the executable?

If you don't actually run the program, how can it be expected to
delete itself?

> 2.if we want that any wildcard characters in command line arguments
> should be appropriately expanded,are we reqd. 2 make any special
> provision?if yes,which?

If the shell from which you invoked the program does not expand
wildcards for you, you will have to expand those wildcards manually.
How you do so depends on what utilities are available to you. There's
no facility in the standard library that I'm aware of that will do
this for you. Otherwise, I'm not sure what you mean by special
provision.

> 3.why :: printf("%%%%%") ; output %%%.

This should be answered in your handy C reference manual (H&S4, p378;
K&R2, p244).

I will remind you again that this newsgroup is not meant to be a
substitute for a good reference manual.

> 4.how 2 run a .obj file without previously creating any .exe?

This is not a question about C, but about how your particular
compiler/linker/platform combination produce executable code.

FWIW, on most platforms I'm familiar with, you can't run the .obj file
directly.

> 5.what is classical class?(FOR C++)

This question should be answered by your handy C++ reference manual.

>
> bye,

Christopher Benson-Manica

unread,
Sep 26, 2003, 12:09:05 PM9/26/03
to
Irrwahn Grausewitz <irrwahn33...@freenet.de> spoke thus:

> IMO printf("%"); invokes undefined behaviour because it
> consits of an invalid conversion specification, according
> to ISO/IEC 9899:1999 7.19.6.1#9.

Why is the compiler allowed to compile this? In other words, why mustn't it
interpret the %" as a conversion specifier and consequently inform you about
an unterminated string constant?

(FWIW, gcc warns about "spurious trailing '%' in format.")

--
Christopher Benson-Manica | Jumonji giri, for honour.
ataru(at)cyberspace.org |

Mike Wahler

unread,
Sep 26, 2003, 12:00:03 PM9/26/03
to

"Dan Pop" <Dan...@cern.ch> wrote in message
news:bl1geu$emi$5...@sunnews.cern.ch...

> In <7QQcb.4714$NX3....@newsread3.news.pas.earthlink.net> "Mike Wahler"
<mkwa...@mkwahler.net> writes:
>
> >"ROSY" <debashis...@rediffmail.com> wrote in message
> >news:730a1617.03092...@posting.google.com...
> >
> >> 3.why :: printf("%%%%%") ; output %%%.
> >
> >Look up 'escape sequence' in a C book.
>
> Huh?!? Can't see any escape sequence in this format string.

See my self correction this thread.

> And the
> effect of the 5th '%' sign can't be explained by any C book, being
> undefined.

Good eye! I didn't notice there was odd number of '%'

-Mike

Jack Klein

unread,
Sep 26, 2003, 12:58:46 PM9/26/03
to
On Fri, 26 Sep 2003 16:09:05 +0000 (UTC), Christopher Benson-Manica
<at...@nospam.cyberspace.org> wrote in comp.lang.c:

> Irrwahn Grausewitz <irrwahn33...@freenet.de> spoke thus:
>
> > IMO printf("%"); invokes undefined behaviour because it
> > consits of an invalid conversion specification, according
> > to ISO/IEC 9899:1999 7.19.6.1#9.
>
> Why is the compiler allowed to compile this? In other words, why mustn't it
> interpret the %" as a conversion specifier and consequently inform you about
> an unterminated string constant?
>
> (FWIW, gcc warns about "spurious trailing '%' in format.")

There is no unterminated string constant. String literals are
converted to unnamed arrays of char by the compiler, which cares
nothing at all for the '%' character. The only character that matters
to the compiler in a string literal is '\'.

Some compilers have options to check the format string against the
arguments at compile time, but this is not required by the standard.
Passing a mis-match list of arguments to printf() at run time is just
plain undefined behavior, as Irrwahn quoted, and an implementation is
NEVER required to diagnose undefined behavior.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++ ftp://snurse-l.org/pub/acllc-c++/faq

Irrwahn Grausewitz

unread,
Sep 26, 2003, 1:46:37 PM9/26/03
to
Christopher Benson-Manica <at...@nospam.cyberspace.org> wrote:

>Irrwahn Grausewitz <irrwahn33...@freenet.de> spoke thus:
>
>> IMO printf("%"); invokes undefined behaviour because it
>> consits of an invalid conversion specification, according
>> to ISO/IEC 9899:1999 7.19.6.1#9.
>
>Why is the compiler allowed to compile this? In other words, why mustn't it
>interpret the %" as a conversion specifier and consequently inform you about
>an unterminated string constant?

The standard doesn't require diagnostics in case of UB.
Once UB is invoked, the implementation is free to do whatever it likes.
You'd better not run the above code on a DS9000.

>(FWIW, gcc warns about "spurious trailing '%' in format.")

That's nice of it, isn't it? :)

Bertrand Mollinier Toublet

unread,
Sep 26, 2003, 2:36:39 PM9/26/03
to
Joona I Palaste wrote:
> goose <ru...@webmail.co.za> scribbled the following:
>
>>debashis...@rediffmail.com (ROSY) wrote in message news:<730a1617.03092...@posting.google.com>...
>>
>>>hello,
>>> response if u ,on all level of questions:::
>
>>idiot!!!
>
> Seconded. You (ROSY) should also invest in a readable writing style and
> not h4x0r d00d l33tsp33k like this.
> I'll rewrite your questions like they would have been posed by a sane
> person.
>
> Hello, respond if you are on all level of questions.
>
That still doesn't make sense to me. Either I am missing something or
you didn't quite achieve what you said you would ("rewrite the questions
as would have been posed by a sane person").

>
>>>3.why :: printf("%%%%%") ; output %%%.
>
> Why printf("%%%%%"); outputs %%%?
>
Ah, I don't think so. Maybe you should avoid treading on such slippery
slopes. When correcting someone's language (be it English or C), you
will agree that you have to be spotless (and this is actually why most
spelling and grammar newsgroups are such flame fields). That would at
the very least (not considering how to gracefully mix code and English) be:

Why does printf("%%%%%"); output %%%?

> In English we write "your" or "you're". No
> points deducted for confusing the two, native speakers also often do.

I will certainly not agree with that. The difference between "your" and
"you're", as between "its" and "it's" or between "they're" and "their"
is not all that subtle. Allowing some phonetic switching but forbidding
other (as you do below) is plain hypocrisy.

> 2) Numbers are numbers, words are words, and never the twain shall
> meet. "Words" like "2" for "to" and "4" for "four" belong to 12-year-
> old script kiddies.

--
Bertrand Mollinier Toublet
"Bikes are like ladies, if you don't take care of them all the time,
when you feel like going back to them, it takes a lot of work"
-- Riccardo Turchetto

Keith Thompson

unread,
Sep 26, 2003, 4:58:41 PM9/26/03
to
Christopher Benson-Manica <at...@nospam.cyberspace.org> writes:
> Irrwahn Grausewitz <irrwahn33...@freenet.de> spoke thus:
>
> > IMO printf("%"); invokes undefined behaviour because it
> > consits of an invalid conversion specification, according
> > to ISO/IEC 9899:1999 7.19.6.1#9.
>
> Why is the compiler allowed to compile this? In other words, why mustn't it
> interpret the %" as a conversion specifier and consequently inform you about
> an unterminated string constant?
>
> (FWIW, gcc warns about "spurious trailing '%' in format.")

The format string is interpreted at run time, not at compilation time.
For example:

char *s = some_func(); # happens to return "%"
printf(s);

Since there's no opportunity in the general case to check this during
compilation, the compiler isn't required to check it in the special
case of passing a string literal. It's good that gcc gives a warning,
but it's not required to.

--
Keith Thompson (The_Other_Keith) k...@cts.com <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://www.sdsc.edu/~kst>
Schroedinger does Shakespeare: "To be *and* not to be"

Mark McIntyre

unread,
Sep 26, 2003, 5:47:53 PM9/26/03
to
On 25 Sep 2003 20:15:22 -0700, in comp.lang.c ,
debashis...@rediffmail.com (ROSY) wrote:

>hello,
> response if u ,on all level of questions:::
>1.how a self deletable .exe file deleted on some future date & time
>without invoking the .exe itself?

This is not a C question. Please ask it again in a group specialising
in your operating system as it is specific to that. You've already
been told this by the way.

>2.if we want that any wildcard characters in command line arguments
>should be appropriately expanded,are we reqd. 2 make any special
>provision?if yes,which?

Expanded to what? If you want to expand wildcards, write some code.

>3.why :: printf("%%%%%") ; output %%%.

it doesnt, it prints %%. This is because each %% is converted to a %,
and the stray lonely % at the end is ignored.

>4.how 2 run a .obj file without previously creating any .exe?

This is not a C question. Please ask it again in a group specialising
in your operating system but be aware that its not even a meaningful
question for most OSen. Its akin to saying "how can I use my computer
without previously connecting the parts together?"

>5.what is classical class?(FOR C++)

This is not a C question. Please ask it again in a C++ group


--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.angelfire.com/ms3/bchambless0/welcome_to_clc.html>

Irrwahn Grausewitz

unread,
Sep 26, 2003, 6:19:01 PM9/26/03
to
Mark McIntyre <markmc...@spamcop.net> wrote:

>On 25 Sep 2003 20:15:22 -0700, in comp.lang.c ,
>debashis...@rediffmail.com (ROSY) wrote:
>

<OT rubbish snipped>


>>3.why :: printf("%%%%%") ; output %%%.
>
>it doesnt, it prints %%. This is because each %% is converted to a %,
>and the stray lonely % at the end is ignored.

No. It invokes undefined behaviour. Your implementation may stop
translation, issue a diagnostic, print %%%, print %%, print "Strength is
irrelevant, resistance is futile!" and assimilate you, transfer all your
money to my bank account, nuke Labrador, or whatever.

<SNIP>

Peter Nilsson

unread,
Sep 26, 2003, 10:34:06 PM9/26/03
to
"Jack Klein" <jack...@spamcop.net> wrote in message
news:itr8nv8hnq6t2o7hf...@4ax.com...
>
> ... an implementation is NEVER required to diagnose undefined behavior.

A constraint violation requires a diagnostic.

--
Peter


Mike Wahler

unread,
Sep 26, 2003, 11:34:15 PM9/26/03
to
"Peter Nilsson" <ai...@acay.com.au> wrote in message
news:3f74...@news.rivernet.com.au...

Correct, but to which constraint violation do you refer?

Undefined behavior and constraint violations are not the
same thing (see 5.1.1.3 below), which specifically
distinguishes between them.

============

ISO/IEC 9899:1999 (E)

3. Terms, definitions, and symbols

[...]

3.4.3

1 undefined behavior

behavior, upon use of a nonportable or erroneous program
construct or of erroneous data, for which this International
Standard imposes no requirements

2 NOTE Possible undefined behavior ranges from ignoring the
situation completely with unpredictable results, to behaving
during translation or program execution in a documented manner
characteristic of the environment (with or without the issuance
of a diagnostic message), to terminating a translation or
execution (with the issuance of a diagnostic message).

3 EXAMPLE An example of undefined behavior is the behavior on
integer overflow.

[...]

3.8

1 constraint

restriction, either syntactic or semantic, by which the
exposition of language elements is to be interpreted

[...]

5.1.1.3 Diagnostics

1 A conforming implementation shall produce at least one diagnostic
message (identified in an implementation-defined manner) if a
preprocessing translation unit or translation unit contains a
violation of any syntax rule or constraint, even if the behavior
is also explicitly specified as undefined or implementation-defined.
Diagnostic messages need not be produced in other circumstances.(8)

2 EXAMPLE An implementation shall issue a diagnostic for the
translation unit:

char i;
int i;

because in those cases where wording in this International Standard
describes the behavior for a construct as being both a constraint
error and resulting in undefined behavior, the constraint error shall
be diagnosed.

[...]

(8) The intent is that an implementation should identify the nature
of, and where possible localize, each violation. Of course, an
implementation is free to produce any number of diagnostics as long
as a valid program is still correctly translated. It may also
successfully translate an invalid program.

============


-Mike

Peter Nilsson

unread,
Sep 27, 2003, 7:43:10 AM9/27/03
to
"Mike Wahler" <mkwa...@mkwahler.net> wrote in message
news:Xy7db.5821$NX3....@newsread3.news.pas.earthlink.net...

> "Peter Nilsson" <ai...@acay.com.au> wrote in message
> news:3f74...@news.rivernet.com.au...
> > "Jack Klein" <jack...@spamcop.net> wrote in message
> > news:itr8nv8hnq6t2o7hf...@4ax.com...
> > >
> > > ... an implementation is NEVER required to diagnose undefined
behavior.
> >
> > A constraint violation requires a diagnostic.
>
> Correct, but to which constraint violation do you refer?

Take your pick.

<snip>


> 2 EXAMPLE An implementation shall issue a diagnostic for the
> translation unit:
>
> char i;
> int i;
>
> because in those cases where wording in this International Standard
> describes the behavior for a construct as being both a constraint
> error and resulting in undefined behavior, the constraint error shall
> be diagnosed.

That will do nicely. :-)

Arguing that it is the constraint violation which is being diagnosed, not
the undefined behaviour, seems a rather moot point.

--
Peter


Christopher Benson-Manica

unread,
Sep 27, 2003, 10:48:15 AM9/27/03
to
Keith Thompson <k...@cts.com> spoke thus:

> Since there's no opportunity in the general case to check this during
> compilation, the compiler isn't required to check it in the special
> case of passing a string literal. It's good that gcc gives a warning,
> but it's not required to.

Oh I see. Thanks... (please excuse me while I feel stupid for a bit ;) )

Message has been deleted

Mike Wahler

unread,
Sep 27, 2003, 2:03:46 PM9/27/03
to
"Arthur J. O'Dwyer" <a...@nospam.andrew.cmu.edu> wrote in message
news:Pine.LNX.4.58-035....@unix44.andrew.cmu.edu...
>

> Okay, now *I'm* confused. Jack's statement was actually made
> in the context of the C statement
>
> printf("%%%%%") ;
>
> which contains no constraint violation. So did you (Peter)
> just randomly decide to explain under what conditions
> diagnostics are required, just in case somebody didn't know?
> or is there some method to your madness that none of us can
> see -- e.g., there being a constraint violation in the line
>
> printf("%%%%%");
>
> ?

Arthur: Thanks for taking time to say that for me,
so I don't need to. :-)

-Mike


Keith Thompson

unread,
Sep 27, 2003, 2:56:22 PM9/27/03
to
Christopher Benson-Manica <at...@nospam.cyberspace.org> writes:
> Keith Thompson <k...@cts.com> spoke thus:
>
> > Since there's no opportunity in the general case to check this during
> > compilation, the compiler isn't required to check it in the special
> > case of passing a string literal. It's good that gcc gives a warning,
> > but it's not required to.
>
> Oh I see. Thanks... (please excuse me while I feel stupid for a bit ;) )

We all get used to it around here. 8-)}

goose

unread,
Sep 27, 2003, 3:28:49 PM9/27/03
to
Joona I Palaste <pal...@cc.helsinki.fi> wrote in message news:<bl1bcd$lre$1...@oravannahka.helsinki.fi>...

<snipped>


ooooh ... i just cannot resist :-)

> I'll rewrite your questions like they would have been posed by a sane
> person.
>
> Hello, respond if you are on all level of questions.
>
> >> 1.how a self deletable .exe file deleted on some future date & time
> >> without
> >> invoking the .exe itself?
>
> How can a self-deletable .exe file delete itself on some future date
> and time without invoking the .exe file itself?

thats an easy one. you hand the sysad for the machine a battle-axe,
and tell him when you want the .exe file deleted :-)

>
> >> 2.if we want that any wildcard characters in command line arguments
> >> should be appropriately expanded,are we reqd. 2 make any special
> >> provision?if yes,which?
>
> If we want any wildcard characters in command line arguments to be
> appropriately expanded, are we required to make any special provision?
> If yes, which?
>
> >> 3.why :: printf("%%%%%") ; output %%%.
>
> Why printf("%%%%%"); outputs %%%?

because its a well-known fact that printf cannot count past three.
studies are currently being done in this field (by those who got
too bored with reality tv) to understand why printf cannot count past
three.

>
> >> 4.how 2 run a .obj file without previously creating any .exe?
>
> How to run a .obj file without previously creating any .exe file?

an easy way to get anything/anyone to run is to place a large, fierce
yet slow *enough* dog behind them/it.

>
> >> 5.what is classical class?(FOR C++)
>
> What is a classical class? (For C++)

thats the one that i flunked out in second-year
on campus. ROSY, dont worry too much about the
"C++" bit of the question. they just put that in
there to confuse you.

<snipped many important rules that i unfortunately break sometimes>

goose,
I've got the body of a 25-year old ... and its not
even against her will either :-)

Mark McIntyre

unread,
Sep 27, 2003, 6:00:53 PM9/27/03
to
On Sat, 27 Sep 2003 00:19:01 +0200, in comp.lang.c , Irrwahn
Grausewitz <irrwahn33...@freenet.de> wrote:

>Mark McIntyre <markmc...@spamcop.net> wrote:
>
>>On 25 Sep 2003 20:15:22 -0700, in comp.lang.c ,
>>debashis...@rediffmail.com (ROSY) wrote:
>>
><OT rubbish snipped>
>>>3.why :: printf("%%%%%") ; output %%%.
>>
>>it doesnt, it prints %%. This is because each %% is converted to a %,
>>and the stray lonely % at the end is ignored.
>
>No. It invokes undefined behaviour.

Indeed. I should have said so.

>Your implementation may stop
>translation, issue a diagnostic, print %%%, print %%, print "Strength is
>irrelevant, resistance is futile!" and assimilate you, transfer all your
>money to my bank account, nuke Labrador, or whatever.

All true. The most likely however is that it'll get ignored.

Peter Nilsson

unread,
Sep 27, 2003, 7:20:59 PM9/27/03
to
"Arthur J. O'Dwyer" <a...@nospam.andrew.cmu.edu> wrote in message
news:Pine.LNX.4.58-035....@unix44.andrew.cmu.edu...
> On Sat, 27 Sep 2003, Peter Nilsson wrote:
> > "Mike Wahler" <mkwa...@mkwahler.net> wrote...
> > > "Peter Nilsson" <ai...@acay.com.au> wrote...
> > > > "Jack Klein" <jack...@spamcop.net> wrote...

> > > > >
> > > > > ... an implementation is NEVER required to diagnose
> > > > > undefined behavior.

I see now that I should have prefixed my reply...

Although, this is not true in general.

> > > > A constraint violation requires a diagnostic.
> > >
> > > Correct, but to which constraint violation do you refer?
> >
> > Take your pick.
>

> Okay, now *I'm* confused. Jack's statement was actually made
> in the context of the C statement
>
> printf("%%%%%") ;
>
> which contains no constraint violation.

And mine was made with that context removed. I wasn't trying to misrepresent
Jack, I was merely focusing on a statement which drew my attention.

> So did you (Peter)
> just randomly decide to explain under what conditions
> diagnostics are required, just in case somebody didn't know?

Lose the 'randomly' and you have it.

I decided to explain (rather poorly as it seems) that certain forms of
undefined behaviour do indeed *require* a diagnostic. [printf format
specifiers are not part of that list though.]

--
Peter


Peter Nilsson

unread,
Sep 27, 2003, 7:21:00 PM9/27/03
to
"Mike Wahler" <mkwa...@mkwahler.net> wrote in message
news:6ikdb.6456$NX3....@newsread3.news.pas.earthlink.net...

Well, I guess I'm mad in thinking that certain forms of undefined behaviour
do indeed require diagnostics. So be it.

--
Peter


Mike Wahler

unread,
Sep 27, 2003, 10:05:21 PM9/27/03
to

"Peter Nilsson" <ai...@acay.com.au> wrote in message
news:3f76...@news.rivernet.com.au...

> "Mike Wahler" <mkwa...@mkwahler.net> wrote in message
> news:6ikdb.6456$NX3....@newsread3.news.pas.earthlink.net...
> > "Arthur J. O'Dwyer" <a...@nospam.andrew.cmu.edu> wrote in message
> > news:Pine.LNX.4.58-035....@unix44.andrew.cmu.edu...
> ...
> > > Okay, now *I'm* confused. Jack's statement was actually made
> > > in the context of the C statement
> > >
> > > printf("%%%%%") ;
> > >
> > > which contains no constraint violation. So did you (Peter)
> > > just randomly decide to explain under what conditions
> > > diagnostics are required, just in case somebody didn't know?
> > > or is there some method to your madness that none of us can
> > > see -- e.g., there being a constraint violation in the line
> > >
> > > printf("%%%%%");
> > >
> > > ?
> >
> > Arthur: Thanks for taking time to say that for me,
> > so I don't need to. :-)
>
> Well, I guess I'm mad

I doubt mad, but perhaps misinformed or misunderstanding.

>in thinking that certain forms of undefined behaviour
> do indeed require diagnostics.

What brought you to that conclusion?

>So be it.

So fix it. :-)

-Mike


Mike Wahler

unread,
Sep 27, 2003, 10:21:26 PM9/27/03
to
"Peter Nilsson" <ai...@acay.com.au> wrote in message
news:3f76...@news.rivernet.com.au...

> "Arthur J. O'Dwyer" <a...@nospam.andrew.cmu.edu> wrote in message
> news:Pine.LNX.4.58-035....@unix44.andrew.cmu.edu...
> > On Sat, 27 Sep 2003, Peter Nilsson wrote:
> > > "Mike Wahler" <mkwa...@mkwahler.net> wrote...
> > > > "Peter Nilsson" <ai...@acay.com.au> wrote...
> > > > > "Jack Klein" <jack...@spamcop.net> wrote...
> > > > > >
> > > > > > ... an implementation is NEVER required to diagnose
> > > > > > undefined behavior.
>
> I see now that I should have prefixed my reply...
>
> Although, this is not true in general.

Restoring context:

Jack Klein wrote:
> ... an implementation is NEVER required to diagnose undefined behavior.

Peter Nillson replied:


> A constraint violation requires a diagnostic.

So you say you should have prefaced your reply with


"Although, this is not true in general."

Which gives us:

Jack Klein wrote:
> ... an implementation is NEVER required to diagnose undefined behavior.

Peter Nillson replied:
> Although, this is not true in general,


> A constraint violation requires a diagnostic.

So in essence you just said, "What I'm about to say is
not true in general", and then made an assertion.
In which case I'd have expected you to at least
say under what circumstances it *is* true.

Don't bother, there are no such circumstances. When
I saw Jack make his assertion, I personally gave him
the credibility he's earned here. But 'just in case'
I checked the standard. It supports his statement
100%.

And how you got from 'undefined behavior' to
'constraint violation', I don't know. They're
two separate issues.


> > > > > A constraint violation requires a diagnostic.
> > > >
> > > > Correct, but to which constraint violation do you refer?
> > >
> > > Take your pick.
> >
> > Okay, now *I'm* confused. Jack's statement was actually made
> > in the context of the C statement
> >
> > printf("%%%%%") ;
> >
> > which contains no constraint violation.
>
> And mine was made with that context removed. I wasn't trying to
misrepresent
> Jack, I was merely focusing on a statement which drew my attention.

Context is always important. Always.

> > So did you (Peter)
> > just randomly decide to explain under what conditions
> > diagnostics are required, just in case somebody didn't know?
>
> Lose the 'randomly' and you have it.

So that gives us:

"So did you (Peter) just decide to explain under what conditions


diagnostics are required, just in case somebody didn't know?"

To which you now seem to be replying in the affirmative.
Perhaps you 'decided' to explain, but you never explained.
What conditions are they?

>
> I decided to explain (rather poorly as it seems)

Not even poorly. An assertion is not an explanation.

Again, all you said was:


"A constraint violation requires a diagnostic."

That is not an explanation.

> that certain forms of
> undefined behaviour

Which 'certain forms'? Not only did you not explain,
you did not enumerate these forms.

>do indeed *require* a diagnostic.

None do. If you feel otherwise, please cite them
along with supporting material from the standard.


> [printf format
> specifiers are not part of that list though.]

Of course not. No entity at all can be part of an empty set.

-Mike


Arthur J. O'Dwyer

unread,
Sep 27, 2003, 10:50:49 PM9/27/03
to

On Sun, 28 Sep 2003, Peter Nilsson wrote:

>
> "Arthur J. O'Dwyer" <a...@nospam.andrew.cmu.edu> wrote:
> > On Sat, 27 Sep 2003, Peter Nilsson wrote:
> > > "Mike Wahler" <mkwa...@mkwahler.net> wrote...
> > > > "Peter Nilsson" <ai...@acay.com.au> wrote...
> > > > > "Jack Klein" <jack...@spamcop.net> wrote...
> > > > > >
> > > > > > ... an implementation is NEVER required to diagnose
> > > > > > undefined behavior.

[Peter should have said:]


> Although, this is not true in general.
> > > > > A constraint violation requires a diagnostic.

> > Okay, now *I'm* confused. Jack's statement was actually made


> > in the context of the C statement
> >
> > printf("%%%%%") ;
> >
> > which contains no constraint violation.
>
> And mine was made with that context removed. I wasn't trying to misrepresent
> Jack, I was merely focusing on a statement which drew my attention.

> I decided to explain (rather poorly as it seems) that certain forms of


> undefined behaviour do indeed *require* a diagnostic. [printf format
> specifiers are not part of that list though.]

And I say again, *no*! Undefined behavior is by definition undefined,
and thus requires *nothing*, including diagnostics. Constraint
violations, OTOH, *do* require diagnostics. They're different
categories altogether, and AFAIK they're completely disjoint.

If you can come up with a construction which exhibits both a
constraint violation *and* undefined behavior, as part of the
same construct (I'm not really sure what that means anyway),
or an example of undefined behavior that requires a diagnostic,
then I'll have learned something. But AFAIK constraint violations
are one thing and undefined behavior is another thing, and never
the twain shall meet.

-Arthur

pete

unread,
Sep 28, 2003, 1:43:41 AM9/28/03
to

int array[1], *pointer = (char*)array;

--
pete

Irrwahn Grausewitz

unread,
Sep 28, 2003, 2:28:25 AM9/28/03
to

ISO/IEC 9899:1999
5.1.1.3 Diagnostics
[...]


2 EXAMPLE An implementation shall issue a diagnostic for the
translation unit:
char i;
int i;
because in those cases where wording in this International
Standard describes the behavior for a construct as being both
a constraint error and resulting in undefined behavior, the
constraint error shall be diagnosed.

Regards

Irrwahn
--
Great minds run in great circles.

Message has been deleted

Mark Gordon

unread,
Sep 28, 2003, 2:46:01 PM9/28/03
to
On Sun, 28 Sep 2003 12:51:19 -0400 (EDT)

"Arthur J. O'Dwyer" <a...@nospam.andrew.cmu.edu> wrote:

>
> On Sun, 28 Sep 2003, pete wrote:
> >
> > Arthur J. O'Dwyer wrote:
> > > On Sun, 28 Sep 2003, Peter Nilsson wrote:
> > > > > > > > "Jack Klein" <jack...@spamcop.net> wrote...
> > > > > > > > >
> > > > > > > > > ... an implementation is NEVER required to diagnose
> > > > > > > > > undefined behavior.
>

> > > > I decided to explain (rather poorly as it seems) that certain
> > > > forms of undefined behaviour do indeed *require* a diagnostic.
> > > > [printf format specifiers are not part of that list though.]
>

> > > If you can come up with a construction which exhibits both a
> > > constraint violation *and* undefined behavior, as part of the
> > > same construct (I'm not really sure what that means anyway),
> > > or an example of undefined behavior that requires a diagnostic,
> > > then I'll have learned something. But AFAIK constraint violations
> > > are one thing and undefined behavior is another thing, and never
> > > the twain shall meet.
> >
> > int array[1], *pointer = (char*)array;
>

> Sorry, pete, I don't get it. Is the above undefined or
> incorrect in some way?

array is an array of ints which is being cast to a char*
*pointer is a pointer to an int which is having a pointer to char
assigned to it.

IIRC you are not allowed to assign a pointer to char to another pointer
type without a cast and I don't think the conversion from int* -> char*
-> int* is guaranteed.

> And thanks, Irrwahn, for pointing out that such examples do
> exist, somewhere -- or at least the Standard-writers thought
> they did. :-)

People are infinitely imaginative when it comes to finding ways to do
things wrong :-)
--
Mark Gordon
Paid to be a Geek & a Senior Software Developer
Although my email address says spamtrap, it is real and I read it.

Peter Nilsson

unread,
Sep 28, 2003, 6:20:07 PM9/28/03
to
"Arthur J. O'Dwyer" <a...@nospam.andrew.cmu.edu> wrote in message news:<Pine.LNX.4.58-035....@unix47.andrew.cmu.edu>...

> On Sun, 28 Sep 2003, pete wrote:
> >
> > Arthur J. O'Dwyer wrote:
> > > On Sun, 28 Sep 2003, Peter Nilsson wrote:
> > > > > > > > "Jack Klein" <jack...@spamcop.net> wrote...
> > > > > > > > >
> > > > > > > > > ... an implementation is NEVER required to diagnose
> > > > > > > > > undefined behavior.
>
> > > > I decided to explain (rather poorly as it seems) that certain forms of
> > > > undefined behaviour do indeed *require* a diagnostic. [printf format
> > > > specifiers are not part of that list though.]
>
> > > If you can come up with a construction which exhibits both a
> > > constraint violation *and* undefined behavior, as part of the
> > > same construct (I'm not really sure what that means anyway),
> > > or an example of undefined behavior that requires a diagnostic,
> > > then I'll have learned something. But AFAIK constraint violations
> > > are one thing and undefined behavior is another thing, and never
> > > the twain shall meet.

So when you see a required diagnostic, it's invariably your belief
that the code is well defined and the warning/error is spurious and
purely there because the standard writers thought the compiler should
say something of no practical significance?!!

> And thanks, Irrwahn, for pointing out that such examples do
> exist, somewhere -- or at least the Standard-writers thought
> they did. :-)

You have Mike to thank for the quote originally. In some random act of
madness you decided to snip it when I first ticked it as a suitable
example! ;)

If you want another I pulled up the very first constraint header 6.4p2
and took about half a second to come up with...

putchar('x);

Such examples are not hard to conceive!

My original point was that a required diagnostic is, more often than
not, as much for the undefined behaviour as for the constraint
violation. Certainly, that's how I've always perceived compiler
errors.

I concede that not all constraint violations are ex-officio invokers
of undefined behaviour. Clearly I got it wrong as a language lawyer.

But I have to ask both Mike and yourself, what do you think
constraints are for? Why bother with them if they only report well
defined code?

--
Peter

ROSY

unread,
Sep 28, 2003, 10:47:39 PM9/28/03
to
ur absolutely *moron* ,stupid .


ru...@webmail.co.za (goose) wrote in message news:<ff82ae1b.03092...@posting.google.com>...

> > hello,
> > response if u ,on all level of questions:::
>

> idiot!!!


>
> > 1.how a self deletable .exe file deleted on some future date & time
> > without
> > invoking the .exe itself?

> > 2.if we want that any wildcard characters in command line arguments
> > should be appropriately expanded,are we reqd. 2 make any special
> > provision?if yes,which?

> > 3.why :: printf("%%%%%") ; output %%%.

> > 4.how 2 run a .obj file without previously creating any .exe?

> > 5.what is classical class?(FOR C++)
> >
>

> by now you should have realised that no one in this
> group will do your homework for you. trying to engage
> them with "expert" questions only further enrages the
> regulars.
>
> goose,
> did you even read the faq for clc yet ?

Message has been deleted

Mike Wahler

unread,
Sep 29, 2003, 1:44:31 AM9/29/03
to
"ROSY" <debashis...@rediffmail.com> wrote in message
news:730a1617.03092...@posting.google.com...

> ur absolutely *moron* ,stupid .

Now *that* is the way to get folks to help you.

Perhaps if you came back to reality, you might
realize that Joona is one of the brighter folks
around here and could give you lots of quality
help. But I doubt he'll be inclined to when
you insult him.

Good luck!


-Mike


Mike Wahler

unread,
Sep 29, 2003, 1:57:46 AM9/29/03
to

"Arthur J. O'Dwyer" <a...@nospam.andrew.cmu.edu> wrote in message
news:Pine.LNX.4.58-035....@unix46.andrew.cmu.edu...

>
> On Sun, 28 Sep 2003, Peter Nilsson wrote:
> >
> > Arthur J. O'Dwyer wrote...

> > > On Sun, 28 Sep 2003, pete wrote:
> > > > Arthur J. O'Dwyer wrote:
> > > > > If you can come up with a construction which exhibits both a
> > > > > constraint violation *and* undefined behavior, as part of the
> > > > > same construct (I'm not really sure what that means anyway),
> > > > > or an example of undefined behavior that requires a diagnostic,
> > > > > then I'll have learned something. But AFAIK constraint violations
> > > > > are one thing and undefined behavior is another thing, and never
> > > > > the twain shall meet.
> >
> > So when you see a required diagnostic, it's invariably your belief
> > that the code is well defined
>
> Depends what you mean. My computer is physically incapable of
> producing "undefined" byte values, so my source code is always
> well-defined. Of course, if one of my programs violates a
> constraint, then my C compiler issues a diagnostic and refuses
> to compile the code, as required and allowed, respectively, by
> the Standard. So there does not exist any "program", nor any
> "behavior", defined or otherwise, associated with a program
> which is not correct C. IMHO.

>
> > and the warning/error is spurious
>
> 'Course not! The error would specify (if I'm lucky) which
> constraint had been violated, so I could fix it.

>
> > and purely there because the standard writers thought the
> > compiler should say something of no practical significance?!!
>
> That doesn't make sense. A "C program" which does not compile
> is not, technically speaking, a C program. It's *almost* a
> program, but if it's not something that a C compiler can accept,
> then I wouldn't call it a C program. And in this newsgroup, we
> only talk about the "(un)defined behavior" of C programs.

>
> > > And thanks, Irrwahn, for pointing out that such examples do
> > > exist, somewhere -- or at least the Standard-writers thought
> > > they did. :-)
> >
> > You have Mike to thank for the quote originally. In some random act of
> > madness you decided to snip it when I first ticked it as a suitable
> > example! ;)
>
> Did you? Sorry.

>
> > If you want another I pulled up the very first constraint header 6.4p2
> > and took about half a second to come up with...
> >
> > putchar('x);
>
> How does that invoke UB?

6.4 Lexical elements

Constraints

2 Each preprocessing token that is converted to a token shall
have the lexical form of a keyword, an identifier, a constant,
a string literal, or a punctuator.

Semantics

3 A token is the minimal lexical element of the language in
translation phases 7 and 8. The categories of tokens are:
keywords, identifiers, constants, string literals, and
punctuators. A preprocessing token is the minimal lexical
element of the language in translation phases 3 through 6.
The categories of preprocessing tokens are: header names,
identifiers, preprocessing numbers, character constants,
string literals, punctuators, and single non-white-space
characters that do not lexically match the other preprocessing
token categories. If a ' or a " character matches the last
category, the behavior is undefined. Preprocessing tokens <<<=====
can be separated by white space; this consists of comments
(described later), or white-space characters (space, horizontal
tab, new-line, vertical tab, and form-feed), or both. As
described in 6.10, in certain circumstances during translation
phase 4, white space (or the absence thereof) serves as more
than preprocessing token separation. White space may appear
within a preprocessing token only as part of a header name
or between the quotation characters in a character constant
or string literal.

> In fact, how exactly does that violate
> a constraint?

AFAICT it doesn't.

>I'm having a hard time reading the Standard tonight;
> I know there's some prohibition about unterminated character constants
> in there somewhere, but I can't find it...

See above.

-Mike


pete

unread,
Sep 29, 2003, 6:18:15 AM9/29/03
to
Arthur J. O'Dwyer wrote:
>
> On Sun, 28 Sep 2003, pete wrote:
> >
> > Arthur J. O'Dwyer wrote:
> > > On Sun, 28 Sep 2003, Peter Nilsson wrote:
> > > > > > > > "Jack Klein" <jack...@spamcop.net> wrote...
> > > > > > > > >
> > > > > > > > > ... an implementation is NEVER required to diagnose
> > > > > > > > > undefined behavior.
>
> > > > I decided to explain (rather poorly as it seems) that certain forms of
> > > > undefined behaviour do indeed *require* a diagnostic. [printf format
> > > > specifiers are not part of that list though.]
>
> > > If you can come up with a construction which exhibits both a
> > > constraint violation *and* undefined behavior, as part of the
> > > same construct (I'm not really sure what that means anyway),
> > > or an example of undefined behavior that requires a diagnostic,
> > > then I'll have learned something. But AFAIK constraint violations
> > > are one thing and undefined behavior is another thing, and never
> > > the twain shall meet.
> >
> > int array[1], *pointer = (char*)array;
>
> Sorry, pete, I don't get it. Is the above undefined or
> incorrect in some way?

N869
6.5.16.1 Simple assignment
Constraints
[#1] One of the following shall hold:
-- the left operand has qualified or unqualified
arithmetic type and the right has arithmetic type;
-- the left operand has a qualified or unqualified version
of a structure or union type compatible with the type
of the right;

-- both operands are pointers to qualified or unqualified
versions of compatible types, and the type pointed to
by the left has all the qualifiers of the type pointed
to by the right;
-- one operand is a pointer to an object or incomplete
type and the other is a pointer to a qualified or
unqualified version of void, and the type pointed to by
the left has all the qualifiers of the type pointed to
by the right; or
-- the left operand is a pointer and the right is a null
pointer constant.
-- the left operand has type _Bool and the right is a
pointer.

--
pete

CBFalconer

unread,
Sep 29, 2003, 8:09:33 AM9/29/03
to
Mike Wahler wrote:
> "ROSY" <debashis...@rediffmail.com> wrote in message
>
> > ur absolutely *moron* ,stupid .
>
> Now *that* is the way to get folks to help you.

How come you haven't PLONKED it? If it never gets any responses
it will eventually go away.

--
Chuck F (cbfal...@yahoo.com) (cbfal...@worldnet.att.net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net> USE worldnet address!


Arthur J. O'Dwyer

unread,
Sep 29, 2003, 10:08:58 AM9/29/03
to

On Mon, 29 Sep 2003, CBFalconer wrote:
>
> Mike Wahler wrote:
> > [re: ROSY]

> > Now *that* is the way to get folks to help you.
>
> How come you haven't PLONKED it? If it never gets any responses
> it will eventually go away.

IMHO, ignoring ignorant-type trolls (as opposed to joyriding-type
trolls) often doesn't help. And I do take exception to the many
posters in this thread who respond publicly *only* to quote all
or part of the message, followed by "*PLONK*". That doesn't do
anything useful, guys. If we wanted to know the minutiae of your
client-side filtering system, we'd read your blog. Just plonk
quietly and move on, please.

As for me, I'm enjoying ROSY's colloquy. I particularly like the
mental imagery associated with the repeated idiom "spoke ur nose",
and the Babylonian-l33tsp33k effect of "R u harlot!!!" is really
masterful. You guys don't know what you're missing. :-)

-Arthur

Peter Nilsson

unread,
Sep 29, 2003, 6:08:38 PM9/29/03
to
"Arthur J. O'Dwyer" <a...@nospam.andrew.cmu.edu> wrote in message news:<Pine.LNX.4.58-035....@unix46.andrew.cmu.edu>...
> "C programs" with constraint violations: do not compile,

Chapter and Verse please.

Every one of my compilers successfully translates...

unsigned char *p = 0xFFFE;

The #error directive (not excluded by #if) is the *only* construct in
which an implementation *must* fail to translate a program.

You have heard that Fortran programs are conforming C programs,
haven't you?

The failure to translate a program to an executable is the most common
form of undefined behaviour, but like every other form undefined
behaviour, it is not a general *requirement*.

> thus are not *really* written in C.
<sigh>

You'll have to define what YOU mean by a "real" C program. A
'conforming' program can be pretty much anything. Implementations
would have a hard time selling to the commercial world if they could
only translate strictly conforming programs.

--
Peter

CBFalconer

unread,
Sep 29, 2003, 10:33:48 PM9/29/03
to
"Arthur J. O'Dwyer" wrote:
> On Mon, 29 Sep 2003, CBFalconer wrote:
> > Mike Wahler wrote:
> >
> > > [re: ROSY]
> > > Now *that* is the way to get folks to help you.
> >
> > How come you haven't PLONKED it? If it never gets any responses
> > it will eventually go away.
>
> IMHO, ignoring ignorant-type trolls (as opposed to joyriding-type
> trolls) often doesn't help. And I do take exception to the many
> posters in this thread who respond publicly *only* to quote all
> or part of the message, followed by "*PLONK*". That doesn't do
> anything useful, guys. If we wanted to know the minutiae of your
> client-side filtering system, we'd read your blog. Just plonk
> quietly and move on, please.

My reasoning is that it should at least know its being PLONKED.
It may eventually find out what that means. I then have no
further urge to clutter the newsgroup.

>
> As for me, I'm enjoying ROSY's colloquy. I particularly like the
> mental imagery associated with the repeated idiom "spoke ur nose",
> and the Babylonian-l33tsp33k effect of "R u harlot!!!" is really
> masterful. You guys don't know what you're missing. :-)

IIRC it (ROSY) was originally posting cross-posted. Maybe t'other
newsgroup is more suitable for your amusement? I'm sure it is not
hard to excite ROSY. :-)

I am not trying to start any argument. Just stating views.

Richard Heathfield

unread,
Sep 29, 2003, 10:55:01 PM9/29/03
to
Peter Nilsson wrote:

> "Arthur J. O'Dwyer" <a...@nospam.andrew.cmu.edu> wrote in message
> news:<Pine.LNX.4.58-035....@unix46.andrew.cmu.edu>...
>> "C programs" with constraint violations: do not compile,
>
> Chapter and Verse please.
>
> Every one of my compilers successfully translates...
>
> unsigned char *p = 0xFFFE;
>
> The #error directive (not excluded by #if) is the *only* construct in
> which an implementation *must* fail to translate a program.

I'm not convinced that the implementation /must/ fail to translate a program
under this circumstance. Do you have C&V?

The closest I can find is this:

"A preprocessing directive of the form

# error pp-tokens<opt> new-line

causes the implementation to produce a diagnostic message that includes the
specified sequence of preprocessing tokens."

Nothing there about terminating the program. What did I miss?

--
Richard Heathfield : bin...@eton.powernet.co.uk
"Usenet is a strange place." - Dennis M Ritchie, 29 July 1999.
C FAQ: http://www.eskimo.com/~scs/C-faq/top.html
K&R answers, C books, etc: http://users.powernet.co.uk/eton

Keith Thompson

unread,
Sep 30, 2003, 2:36:32 AM9/30/03
to
Richard Heathfield <dont...@address.co.uk.invalid> writes:
> Peter Nilsson wrote:
[...]

> > The #error directive (not excluded by #if) is the *only* construct in
> > which an implementation *must* fail to translate a program.
>
> I'm not convinced that the implementation /must/ fail to translate a program
> under this circumstance. Do you have C&V?
>
> The closest I can find is this:
>
> "A preprocessing directive of the form
>
> # error pp-tokens<opt> new-line
>
> causes the implementation to produce a diagnostic message that includes the
> specified sequence of preprocessing tokens."
>
> Nothing there about terminating the program. What did I miss?

Section 4 (Conformance), paragraph 4:

The implementation shall not successfully translate a
preprocessing translation unit containing a #error preprocessing
directive unless it is part of a group skipped by conditional
inclusion.

Minti

unread,
Sep 30, 2003, 8:08:42 AM9/30/03
to
debashis...@rediffmail.com (ROSY) wrote in message news:<730a1617.03092...@posting.google.com>...
> hello,
> response if u ,on all level of questions:::
> 1.how a self deletable .exe file deleted on some future date & time
> without
> invoking the .exe itself?

> 2.if we want that any wildcard characters in command line arguments
> should be appropriately expanded,are we reqd. 2 make any special
> provision?if yes,which?
> 3.why :: printf("%%%%%") ; output %%%.
> 4.how 2 run a .obj file without previously creating any .exe?
> 5.what is classical class?(FOR C++)
>

> bye,

When I first checked out the heading of your thread. I thought better
stay out of this iman, you haven't coded much since long time and you
might end up making a fool out of yourself. Well after reading it I
know it was the other way around thanks for helping me make me a
confident man again. You did what Oprah could not do.

Please read the FAQ before you post to a group. Many groups have it
c.l.c also has it.

BTW I have a reason to belive this is your first "expert job
assignment at ISRO".

--
Imanpreet Singh Arora
imanpreet_arora AT yahoo DOT co DOT in

What I can't create, I can't understand.
-- Richard Feynman

Dan Pop

unread,
Sep 30, 2003, 9:38:21 AM9/30/03
to

>"Arthur J. O'Dwyer" <a...@nospam.andrew.cmu.edu> wrote in message news:<Pine.LNX.4.58-035....@unix46.andrew.cmu.edu>...
>> "C programs" with constraint violations: do not compile,
>
>Chapter and Verse please.
>
>Every one of my compilers successfully translates...
>
> unsigned char *p = 0xFFFE;

I wouldn't say that a translation that has generated a mandatory
diagnostic qualifies as successful: the standard doesn't guarantee
*anything* at all about the generated code. And, as far as I know,
the compilers' documentation provides no guarantees, either.

>> thus are not *really* written in C.
><sigh>
>
>You'll have to define what YOU mean by a "real" C program.

That's easy: a program that doesn't require any diagnostic and that
doesn't invoke any form of undefined behaviour that can be detected at
translation time.

I prefer the term "correct C program", as defined by C99, which is a bit
more restrictive.

Dan
--
Dan Pop
DESY Zeuthen, RZ group
Email: Dan...@ifh.de

Message has been deleted

Chris Dollin

unread,
Sep 29, 2003, 6:53:15 AM9/29/03
to
ROSY wrote:

> response if u ,on all level of questions:::

I am not a comma.

> 1.how a self deletable .exe file deleted on some future date & time
> without
> invoking the .exe itself?

This is not a C question.

> 2.if we want that any wildcard characters in command line arguments
> should be appropriately expanded,are we reqd. 2 make any special
> provision?if yes,which?

This is not an implementation-independant C question.

> 3.why :: printf("%%%%%") ; output %%%.

Probably a bug in the run-time support.

> 4.how 2 run a .obj file without previously creating any .exe?

This is not a C question.

> 5.what is classical class?(FOR C++)

This is not a C question, and it's not a C++ question either, but
one answer is, it's a class for the teaching of classics.

Why not post non-C questions to non-C newsgroups ... *please*?

--
Chris "progressive rock hedgehog" Dollin
C FAQs at: http://www.faqs.org/faqs/by-newsgroup/comp/comp.lang.c.html
C welcome: http://www.angelfire.com/ms3/bchambless0/welcome_to_clc.html

Peter Nilsson

unread,
Oct 1, 2003, 6:18:04 PM10/1/03
to
Richard Heathfield <dont...@address.co.uk.invalid> wrote in message news:<blara4$hcf$2...@sparta.btinternet.com>...

> Peter Nilsson wrote:
>
> > "Arthur J. O'Dwyer" <a...@nospam.andrew.cmu.edu> wrote in message
> > news:<Pine.LNX.4.58-035....@unix46.andrew.cmu.edu>...
> >> "C programs" with constraint violations: do not compile,
> >
> > Chapter and Verse please.
> >
> > Every one of my compilers successfully translates...
> >
> > unsigned char *p = 0xFFFE;
> >
> > The #error directive (not excluded by #if) is the *only* construct in
> > which an implementation *must* fail to translate a program.
>
> I'm not convinced that the implementation /must/ fail to translate a program
> under this circumstance. Do you have C&V?

C99 4p4:

The implementation shall not successfully translate a preprocessing
translation unit containing a #error preprocessing directive unless
it is part of a group skipped by conditional inclusion.

--
Peter

Dave Thompson

unread,
Oct 5, 2003, 11:50:55 PM10/5/03
to
On Sun, 28 Sep 2003 19:46:01 +0100, Mark Gordon
<spam...@flash-gordon.me.uk> wrote:

> On Sun, 28 Sep 2003 12:51:19 -0400 (EDT)
> "Arthur J. O'Dwyer" <a...@nospam.andrew.cmu.edu> wrote:

<snip>


> > > int array[1], *pointer = (char*)array;
> >
> > Sorry, pete, I don't get it. Is the above undefined or
> > incorrect in some way?
>
> array is an array of ints which is being cast to a char*
> *pointer is a pointer to an int which is having a pointer to char
> assigned to it.
>
> IIRC you are not allowed to assign a pointer to char to another pointer
> type without a cast and I don't think the conversion from int* -> char*
> -> int* is guaranteed.
>

Correct you can't implicitly convert, and hence assign, pass, return,
or initialize without cast, char* to any other data pointer *except*
void*. (Plus qualification as needed; that's orthogonal to type.)

With cast, the result is guaranteed for char (or void). 6.3.2.3p7:
A pointer to an object or incomplete type may be converted to a
pointer to a different
object or incomplete type. If the resulting pointer is not correctly
aligned57) for the
pointed-to type, the behavior is undefined. Otherwise, when converted
back again, the
result shall compare equal to the original pointer. <snip>

Plus the fact that every object (hence every valid object pointer)
must be sufficiently aligned for character types (and void pointers),
but this is not required for any other data type. And that nonnull
data pointers compare equal iff they point to the same object, or the
special and problematic case &just_past_a == &b, but that shouldn't
apply here.

- David.Thompson1 at worldnet.att.net

0 new messages