473,404 Members | 2,178 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,404 software developers and data experts.

constraint violations and compilation

My question, stated as simply as possible, is: must a constraint
violation, as defined by the standard, cause compilation to halt?

I believe that in the presence of a constraint violation, at
least one diagnostic is required, which, at the discretion of the
compiler writer, may be either an "error" or a "warning."
Generally however, an error halts compilation and a warning does
not. This would seem to imply that it is up to the compiler
writer to decide which constraint violations halt compilation and
which do not.

Richard
Oct 1 '07 #1
3 1799
On Mon, 01 Oct 2007 22:06:37 +0000, Richard Weeks wrote:
My question, stated as simply as possible, is: must a constraint
violation, as defined by the standard, cause compilation to halt?
No.
I believe that in the presence of a constraint violation, at least one
diagnostic is required, which, at the discretion of the compiler writer,
may be either an "error" or a "warning."
It may be any diagnostic. Several compilers have diagnostic categories
other than "error" and "warning", for example "fatal error",
"notification", or "remark".
Generally however, an error
halts compilation and a warning does not. This would seem to imply that
it is up to the compiler writer to decide which constraint violations
halt compilation and which do not.
This is correct.
Oct 1 '07 #2
Richard Weeks said:
My question, stated as simply as possible, is: must a constraint
violation, as defined by the standard, cause compilation to halt?
No. It does mean that a diagnostic message must be produced, but the
Standard does not require translation to be halted.
I believe that in the presence of a constraint violation, at
least one diagnostic is required, which, at the discretion of the
compiler writer, may be either an "error" or a "warning."
<shrugThat's just custom and usage. The Standard doesn't require either a
warning or an error. It only requires a diagnostic message.
Generally however, an error halts compilation and a warning does
not. This would seem to imply that it is up to the compiler
writer to decide which constraint violations halt compilation and
which do not.
It is entirely up to the implementation, yes - all it *has* to do is
diagnose at least one of any syntax errors and constraint violations it
encounters. The implementation is then free to choose whether to continue
or to halt translation.

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
Oct 2 '07 #3
Richard Weeks <rw****@nomail.netwrites:
My question, stated as simply as possible, is: must a constraint
violation, as defined by the standard, cause compilation to halt?
[...]

No, and if a compiler generates an executable (after producing the
required diagnostic), the behavior is undefined.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <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"
Oct 2 '07 #4

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

Similar topics

1
by: valexena | last post by:
Into which file do records rejected by Oracle due to primary key constraint violations get place by SQL* Loader? -- Posted via http://dbforums.com
26
by: Agoston Bejo | last post by:
I want to enforce such a constraint on a column that would ensure that the values be all unique, but this wouldn't apply to NULL values. (I.e. there may be more than one NULL value in the column.)...
6
by: Susanne Klemm | last post by:
Hi! I have a table with a check constraint. But unfortunately it does not work like I wanted. CREATE TABLE MAP ( NOT NULL, NULL,
3
by: ferg | last post by:
I have a Customer table. The table has two different CHECK constraints. Then there is the Customer details dialog, which provides the user with an UI for changing users. I have some UPDATE sql,...
8
by: Sam Kong | last post by:
Hello, I want to define a generic class which should accept only nullable types or reference types. What's the best way to costrain it? --------- class MyClass<T>{ ...
11
by: gnortenjones | last post by:
I have a linked table (to an oracle db), and I am trying to run a simple update query against it to change some data, but I am getting the following error: "...didn't update 0 fields due to a type...
15
by: Frank Swarbrick | last post by:
I have the following three tables DROP TABLE CALLTRAK.SERVICE_CODES @ CREATE TABLE CALLTRAK.SERVICE_CODES ( CODE CHAR(1) NOT NULL , CONSTRAINT SERVICE_CODES_PK PRIMARY KEY (CODE) ,...
12
by: Pietro Cerutti | last post by:
Dear all, I would like to open another topic to try to clarify a doubt raised on my previous post today with the subject 'printf("%d%d%d")'. Reading through the standard, I cannot find a clear...
2
by: Lars | last post by:
I have a compilation error and do not know how to fix it. This is the first time I've tried to use a generic type constraint. What have I done wrong? public sealed class ClassA : IInput {...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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.