473,659 Members | 3,494 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

all errors and warnings in C

i will be very thankful if you sent all the errors and warnings regarding
to the language C

thank you
Nov 14 '05 #1
30 2165
prasanna wrote:
i will be very thankful if you sent all the errors and warnings regarding
to the language C
Warnings and errors depend on the compiler used. The C standard only
dictates what is correct C, it doesn't care what the actual error
messages are what a compiler produces.
thank you


Igmar
Nov 14 '05 #2
"prasanna" <sv**********@i ndiatimes.com> wrote in message
news:11******** *************** *******@localho st.talkaboutpro gramming.com...
i will be very thankful if you sent all the errors and warnings regarding
to the language C


The language standard requires an implementation to issue
a diagnostic message for certain language rule violations.
The actual text of such messages is not specified. I.e.
every message could be simply e.g. "ERROR!". "Warnings" are
not required at all. Most implementations do provide somewhat
meaninful warnings and errors, and each will have their own.
Consult your documentation.
-Mike
Nov 14 '05 #3
"prasanna" <sv**********@i ndiatimes.com> writes:
i will be very thankful if you sent all the errors and warnings regarding
to the language C


I'm afraid your question doesn't make much sense.

A particular compiler might have a list of all the error and warning
messages it can produce, but it's going to be different from the
messages another compiler can produce. Compiler vendors don't
typically provide such lists, since they're not likely to be useful.
In any case, questions about specific compilers are off-topic here.

(The number of mistakes you can make while programming in C is, of
course, unlimited.)

--
Keith Thompson (The_Other_Keit h) 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.
Nov 14 '05 #4
In <11************ *************** ***@localhost.t alkaboutprogram ming.com> "prasanna" <sv**********@i ndiatimes.com> writes:
i will be very thankful if you sent all the errors and warnings regarding
to the language C


The C standard contains the complete list of instances requiring a
compiler diagnostic. It doesn't divide compiler diagnostics into
errors and warnings and it doesn't provide any requirements WRT the
proper phrasing of these diagnostics. It also explicitly allows
implementations to produce other diagnostics than the required ones, as
long as the required ones are produced.

Furthermore, only *one* diagnostic is required for a "faulty" translation
unit, no matter how many standard violations requiring a diagnostic it
contains.

So, the minimal requirements imposed by the language are trivially met
by a compiler displaying a copyright message for each and every
translation unit processed, whether it is perfectly correct or not.

Real implementations usually do better than that, but each decides how
much better.

Dan
--
Dan Pop
DESY Zeuthen, RZ group
Email: Da*****@ifh.de
Nov 14 '05 #5
Mike Wahler wrote:

"prasanna" <sv**********@i ndiatimes.com> wrote in message
news:11******** *************** *******@localho st.talkaboutpro gramming.com...
i will be very thankful if you sent all the errors and warnings regarding
to the language C


The language standard requires an implementation to issue
a diagnostic message for certain language rule violations.
The actual text of such messages is not specified. I.e.
every message could be simply e.g. "ERROR!". "Warnings" are
not required at all. Most implementations do provide somewhat
meaninful warnings and errors, and each will have their own.
Consult your documentation.


Can a compiler "make up" its own warnings? Could a conforming compiler
issue a warning if the definition of main() didn't start on an odd-numbered
line, or if you used the "wrong" method of placing braces?

$ yuckycc -c foo.c
foo.c:8 Warning! Definition of main() should be on an odd-numbered line.
foo.c:10 Warning! I don't like variables named "j".
foo.c:12 Warning! Braces belong indented below the if() line.
foo.c:297 Warning! Length of source file exceeds the day of the year.

--
+-------------------------+--------------------+-----------------------------+
| Kenneth J. Brody | www.hvcomputer.com | |
| kenbrody at spamcop.net | www.fptech.com | #include <std_disclaimer .h> |
+-------------------------+--------------------+-----------------------------+
Nov 14 '05 #6
Kenneth Brody <ke******@spamc op.net> scribbled the following:
Mike Wahler wrote:
"prasanna" <sv**********@i ndiatimes.com> wrote in message
news:11******** *************** *******@localho st.talkaboutpro gramming.com...
> i will be very thankful if you sent all the errors and warnings regarding
> to the language C
The language standard requires an implementation to issue
a diagnostic message for certain language rule violations.
The actual text of such messages is not specified. I.e.
every message could be simply e.g. "ERROR!". "Warnings" are
not required at all. Most implementations do provide somewhat
meaninful warnings and errors, and each will have their own.
Consult your documentation.

Can a compiler "make up" its own warnings? Could a conforming compiler
issue a warning if the definition of main() didn't start on an odd-numbered
line, or if you used the "wrong" method of placing braces? $ yuckycc -c foo.c
foo.c:8 Warning! Definition of main() should be on an odd-numbered line.
foo.c:10 Warning! I don't like variables named "j".
foo.c:12 Warning! Braces belong indented below the if() line.
foo.c:297 Warning! Length of source file exceeds the day of the year.


This is entirely allowed, as long as the compiler actually compiles the
code according to the ISO C standard. The warnings don't even have to
have anything to do with the source code. This is allowed too:

$ yuckycc -c foo.c
foo.c:1 Warning! You are too ugly to be writing C code!
foo.c:2 Warning! Your feet smell! When did you last take a bath?

--
/-- Joona Palaste (pa*****@cc.hel sinki.fi) ------------- Finland --------\
\-- http://www.helsinki.fi/~palaste --------------------- rules! --------/
"It's time, it's time, it's time to dump the slime!"
- Dr. Dante
Nov 14 '05 #7
Kenneth Brody wrote:
Mike Wahler wrote:
"prasanna" <sv**********@i ndiatimes.com> wrote in message
news:11****** *************** *********@local host.talkaboutp rogramming.com. ..
i will be very thankful if you sent all the errors and warnings regarding
to the language C


The language standard requires an implementation to issue
a diagnostic message for certain language rule violations.
The actual text of such messages is not specified. I.e.
every message could be simply e.g. "ERROR!". "Warnings" are
not required at all. Most implementations do provide somewhat
meaninful warnings and errors, and each will have their own.
Consult your documentation.

Can a compiler "make up" its own warnings? Could a conforming compiler
issue a warning if the definition of main() didn't start on an odd-numbered
line, or if you used the "wrong" method of placing braces?

$ yuckycc -c foo.c
foo.c:8 Warning! Definition of main() should be on an odd-numbered line.
foo.c:10 Warning! I don't like variables named "j".
foo.c:12 Warning! Braces belong indented below the if() line.
foo.c:297 Warning! Length of source file exceeds the day of the year.


Yes, of course.

foo.c:1 Warning! Using "foo" as a file name is deprecated.
foo.c:42 Warning! This really isn't The Answer.
foo.c:56 Accolade! malloc() used without a cast.

However, if the program is correct the implementation must
accept and attempt to execute it, no matter how many warnings
or other diagnostics it has issued.

There's no straightforward technical criterion by which
one can determine whether a particular warning is superfluous
or essential: it's matter of the expected "error styles" of the
users. When the compiler draws attention to perfectly correct
C code, it may just be making useless noise -- but on the other
hand, it may be saving your butt.

switch (what) {
case 1:
x = f();
break;
case 2:
x = g();
break;
case3:
x = h();
break;
}

.... is perfectly good C, yet I for one would be glad to be warned
that `x = h();' is not reachable, or that the label `case3' is
not used.

It's a QoI ("Quality of Implementation" ) issue -- and "Q"
is neither one-dimensional nor even measured the same way by
all users of the compiler.

--
Er*********@sun .com

Nov 14 '05 #8
>> > i will be very thankful if you sent all the errors and warnings regarding
> to the language C
The language standard requires an implementation to issue
a diagnostic message for certain language rule violations.
The actual text of such messages is not specified. I.e.
every message could be simply e.g. "ERROR!". "Warnings" are
not required at all. Most implementations do provide somewhat
meaninful warnings and errors, and each will have their own.
Consult your documentation.


Can a compiler "make up" its own warnings?


Yes. Since warnings are not required at all, ALL warnings are "made
up". I consider this true even in spite of a "common warnings"
chapter in the (C90) standard, which does not pretend to contain actual
wordings of warning messages.
Could a conforming compiler
issue a warning if the definition of main() didn't start on an odd-numbered
line, or if you used the "wrong" method of placing braces?

$ yuckycc -c foo.c
foo.c:8 Warning! Definition of main() should be on an odd-numbered line.
foo.c:10 Warning! I don't like variables named "j".
foo.c:12 Warning! Braces belong indented below the if() line.
foo.c:297 Warning! Length of source file exceeds the day of the year.


Yes, and this is acceptable per the standard even if the warning
is a lie (e.g. main() DOES begin on an odd-numbered line). It's a
quality-of-implementation issue.

However, I believe it is not acceptable to have an infinite number
of warnings for a standards-correct program, as that amounts to
failure to compile it. I don't believe that anything in the standard
prohibits the compiler from issuing a warning *AND* deleting the source
code if it generates a correct program.

Gordon L. Burditt
Nov 14 '05 #9
On Mon, 19 Jul 2004 11:12:02 -0400, in comp.lang.c , Kenneth Brody
<ke******@spamc op.net> wrote:
Can a compiler "make up" its own warnings? Could a conforming compiler
issue a warning if the definition of main() didn't start on an odd-numbered
line, or if you used the "wrong" method of placing braces?
Just so long as it doesn't prevent compilation of a valid programme.
$ yuckycc -c foo.c


foo.c:11 warning: I never could get the hang of thursdays.
foo.c:22 information: the Liberator is under attack.

--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.angelfire.c om/ms3/bchambless0/welcome_to_clc. html>
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
Nov 14 '05 #10

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

Similar topics

3
2851
by: Michael G | last post by:
I am getting some errors/warnings that I don't understand. This code is in a Java app that uses Swing J Components with an ActionListener. The code/errors/warnings follow. Thanks for any help, Mike import javax.swing.*; import java.awt.event.*; import java.awt.*; public class GraphicalImp extends UIImp implements ActionListener {
18
1793
by: tomakated | last post by:
Hi, i'm new here and I can't get my get_item_price() function to work I need it to take in 4 items int main() { double item1, item2, item3, item4, lowest=0, total; char response;
1
2607
by: superprad | last post by:
Hi I am trying to write a python wrapper for a C code I have using swig. when i try to compile the wrap.c i get a bunch of these warnings and errors can anyone help $swig -python test_hk.c this generates test_hk.py and test_hk_wrap.c then i compile it as $gcc -Wall -std=c99 test_hk.c test_hk_wrap.c -I/usr/include/python2.3/
2
1269
by: Bern McCarty | last post by:
We have a large source base that we normally compile with /WX (treat all warnings as errors) and /W3. I would like to add the /Wp64 switch to this mix so that developers see the /Wp64 warnings but I don't want them to be treated as errors. Treating them as errors would be impossible at this point since there will be tons of them. At this point my aim is to build awareness and at least get developers that are writing a lot of new code to...
10
1928
by: dbuchanan | last post by:
Hello, >From time to time my vb2005 form disappears and is replaced by the following errors. Rebuilding the application never helps. However the errors never affects the operation of my application that I notice, but it is very anoying. To get rid of the errors I must close the form, close the application and then reopen it.
9
5991
by: guy | last post by:
VB2005 ASP.NET the application i have been working on for some time has just started to give me a 'Build failed' but it does not display the errors window. if i display the errors window manually it shows 0 errors, 0 warnings. I would definitely expect warnings as option strict is off (I am not allowed to turn it on grrrrrr:-( but that is another story) i have restarted the pc, no effect any ideas?
1
1776
by: John Dalberg | last post by:
I converted a working web site project to a web application project and I am getting a bunch of warnings and compile errors. All code using .NET's profile class is giving an error. example line: txtName.Text = Profile.FirstName gives an error: ... FirstName' is not a member of 'Profile'.
0
2330
by: Larry Lard | last post by:
Recently we've been on a code quality drive and have eliminated all compilation warnings from our code. To preserve this state, we've turned 'Treat warnings as errors' to 'All' in all our projects (and if only this could be a solution level setting!). However, we've now found that warnings produced by Code Analysis DO NOT get treated as errors even with this flag set - it looks like this is because the Code Analysis happens after the...
0
1727
by: WebCM | last post by:
PDO offers 3 modes of displaying errors: - silent mode - no errors - warnings - Warning: - exceptions - Exception: Which of them is the fastest and the most adequate for applications like CMS and forums? I've been using exceptions now. However, let's come to the point where EDITOR posts a filled FORM (message, article...). He cannot lose his work!
0
8428
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8851
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8748
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8531
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6181
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5650
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4175
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4335
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1978
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.