473,440 Members | 1,959 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,440 software developers and data experts.

level of questions for experts only

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,
Nov 13 '05
53 3934

On Tue, 30 Sep 2003, Dan Pop wrote:

Peter Nilsson writes:
Arthur J. O'Dwyer wrote...
"C programs" with constraint violations: do not compile,
[because producing a diagnostic doesn't guarantee anything
about the contents of any executable that might be produced]
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 must here disagree with Dan; I'd rather keep my definition,
because the concept of "UB that can be detected at translation time"
is almost certainly not well-defined. OTOH, the Standard quite
*clearly* defines what it means by "constraint violation" (as far
as I can tell), so it's quite obvious whether any particular
program contains a constraint violation or not.

I would call code demonstrating UB a "bad C program" -- but still
a C program, just one without well-defined results when executed.
In other words, it's a C program which is *not* a *correct* C
program, as you say below.
I prefer the term "correct C program", as defined by C99, which
is a bit more restrictive.


True. I bet that determining whether a given program is correct
given only its source code is undecidable, though, so that's not
a very good definition for use by compilers. :-)

-Arthur
Nov 13 '05 #51
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-newsgrou...mp.lang.c.html
C welcome: http://www.angelfire.com/ms3/bchambl...me_to_clc.html
Nov 13 '05 #52
Richard Heathfield <do******@address.co.uk.invalid> wrote in message news:<bl**********@sparta.btinternet.com>...
Peter Nilsson wrote:
"Arthur J. O'Dwyer" <aj*@nospam.andrew.cmu.edu> wrote in message
news:<Pi**********************************@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
Nov 13 '05 #53
On Sun, 28 Sep 2003 19:46:01 +0100, Mark Gordon
<sp******@flash-gordon.me.uk> wrote:
On Sun, 28 Sep 2003 12:51:19 -0400 (EDT)
"Arthur J. O'Dwyer" <aj*@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
Nov 13 '05 #54

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

Similar topics

0
by: Boris Ammerlaan | last post by:
This notice is posted about every week. I'll endeavor to use the same subject line so that those of you who have seen it can kill-file the subject; additionally, Supersedes: headers are used to...
102
by: dreamznatcher | last post by:
Hello, I'm considering a career switch to a more database-related job, but need help on a few questions and issues. I'm a Computer Engineering graduate and have always felt most comfortable...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.