473,670 Members | 2,397 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

C code in Dev-Cpp

What can I do to get Dev-Cpp to compile C code? Whenever I try
compiling C code the compiler complains about the headers.

For instance the code:(I do name the code with extension.c)

#include <stdio.h>
#include <string.h>

int main(int argc, char **argv)
{

char buffer[100];

strcpy(buffer, argv[1]);
printf("%s\n", buffer);

}

gives me the errors:

Compiler: Default compiler
Executing gcc.exe...
gcc.exe "C:\cCode\vulne rable.c" -o "C:\cCode\vulne rable.exe" -ansi -
pedantic -Wall -g3 -O0 -fexceptions -g3 -I"C:\DEV-CPP\include" -L"C:
\DEV-CPP\lib" -g3
In file included from C:/DEV-CPP/include/stdio.h:26,
from C:\cCode\vulner able.c:1:
C:/DEV-CPP/include/stddef.h:6:2: warning: #include_next is a GCC
extension
In file included from C:/DEV-CPP/include/stdio.h:28,
from C:\cCode\vulner able.c:1:
C:/DEV-CPP/include/stdarg.h:6:2: warning: #include_next is a GCC
extension
In file included from C:\cCode\vulner able.c:1:
C:/DEV-CPP/include/stdio.h:330: warning: ISO C90 does not support
`long long'

In file included from C:/DEV-CPP/include/string.h:24,
from C:\cCode\vulner able.c:2:
C:/DEV-CPP/include/stddef.h:6:2: warning: #include_next is a GCC
extension
C:\cCode\vulner able.c: In function `main':

C:\cCode\vulner able.c:12: warning: control reaches end of non-void
function

Execution terminated
Compilation successful

Jun 16 '07 #1
4 2981
"waltbrad" <wa******@hotma il.comwrote in message
news:11******** **************@ o61g2000hsh.goo glegroups.com.. .
What can I do to get Dev-Cpp to compile C code? Whenever I try
compiling C code the compiler complains about the headers.

For instance the code:(I do name the code with extension.c)

#include <stdio.h>
#include <string.h>

int main(int argc, char **argv)
{

char buffer[100];

strcpy(buffer, argv[1]);
printf("%s\n", buffer);

}

gives me the errors:

Compiler: Default compiler
Executing gcc.exe...
gcc.exe "C:\cCode\vulne rable.c" -o "C:\cCode\vulne rable.exe" -ansi -
pedantic -Wall -g3 -O0 -fexceptions -g3 -I"C:\DEV-CPP\include" -L"C:
\DEV-CPP\lib" -g3
In file included from C:/DEV-CPP/include/stdio.h:26,
from C:\cCode\vulner able.c:1:
C:/DEV-CPP/include/stddef.h:6:2: warning: #include_next is a GCC
extension
In file included from C:/DEV-CPP/include/stdio.h:28,
from C:\cCode\vulner able.c:1:
C:/DEV-CPP/include/stdarg.h:6:2: warning: #include_next is a GCC
extension
In file included from C:\cCode\vulner able.c:1:
C:/DEV-CPP/include/stdio.h:330: warning: ISO C90 does not support
`long long'

In file included from C:/DEV-CPP/include/string.h:24,
from C:\cCode\vulner able.c:2:
C:/DEV-CPP/include/stddef.h:6:2: warning: #include_next is a GCC
extension
C:\cCode\vulner able.c: In function `main':

C:\cCode\vulner able.c:12: warning: control reaches end of non-void
function

Execution terminated
Compilation successful
Umm.. "compilatio n successful". Those are warnings. Those warnings are
saying that stdio.h, stdarg.h and string.h contain GCC specific instructions
(#include_next and long long) that are not ISO C90. Yet it would seem that
you continue to get your program. Warning != error.

Jun 16 '07 #2
>
Umm.. "compilatio n successful". Those are warnings. Those warnings are
saying that stdio.h, stdarg.h and string.h contain GCC specific instructions
(#include_next and long long) that are not ISO C90. Yet it would seem that
you continue to get your program. Warning != error.
What's more the reference to C90 proves that the OP is compiling C not C++.

To the OP, -Wall (i.e. turn on all warnings) is the problem. Personally
I wouldn't be happy with a compiler that couldn't compile standard C
header files without warnings but it's your choice.

john
Jun 16 '07 #3

John Harrison <jo************ *@hotmail.comwr ote in message
news:Mc******** *****@newsfe7-win.ntli.net...

Umm.. "compilatio n successful". Those are warnings. Those warnings are
saying that stdio.h, stdarg.h and string.h contain GCC specific
instructions
(#include_next and long long) that are not ISO C90. Yet it would seem
that
you continue to get your program. Warning != error.

What's more the reference to C90 proves that the OP is compiling C not
C++.
>
To the OP, -Wall (i.e. turn on all warnings) is the problem. Personally
I wouldn't be happy with a compiler that couldn't compile standard C
header files without warnings but it's your choice.
john
I wonder if turning on 'C99' would help.
-std=c99
or:
-std=iso9899:199 9
or:
-std=gnu99 // C99 + GNU extensions

--
Bob R
POVrookie
Jun 16 '07 #4
On Jun 16, 11:26 am, waltbrad <waltb...@hotma il.comwrote:
What can I do to get Dev-Cpp to compile C code? Whenever I try
compiling C code the compiler complains about the headers.

For instance the code:(I do name the code with extension.c)

#include <stdio.h>
#include <string.h>

int main(int argc, char **argv)
{

char buffer[100];

strcpy(buffer, argv[1]);
printf("%s\n", buffer);

}

gives me the errors:

Compiler: Default compiler
Executing gcc.exe...
gcc.exe "C:\cCode\vulne rable.c" -o "C:\cCode\vulne rable.exe" -ansi -
pedantic -Wall -g3 -O0 -fexceptions -g3 -I"C:\DEV-CPP\include" -L"C:
\DEV-CPP\lib" -g3
In file included from C:/DEV-CPP/include/stdio.h:26,
from C:\cCode\vulner able.c:1:
C:/DEV-CPP/include/stddef.h:6:2: warning: #include_next is a GCC
extension
In file included from C:/DEV-CPP/include/stdio.h:28,
from C:\cCode\vulner able.c:1:
C:/DEV-CPP/include/stdarg.h:6:2: warning: #include_next is a GCC
extension
In file included from C:\cCode\vulner able.c:1:
C:/DEV-CPP/include/stdio.h:330: warning: ISO C90 does not support
`long long'

In file included from C:/DEV-CPP/include/string.h:24,
from C:\cCode\vulner able.c:2:
C:/DEV-CPP/include/stddef.h:6:2: warning: #include_next is a GCC
extension
C:\cCode\vulner able.c: In function `main':

C:\cCode\vulner able.c:12: warning: control reaches end of non-void
function

Execution terminated
Compilation successful
the last warning is due to declaration of main as returning int but
providing a body that returns nothing.Put this line before '}' of the
main function:

return 0;

and one warning is reduced.

Jun 16 '07 #5

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

Similar topics

9
3762
by: F. GEIGER | last post by:
I've dev'ed a Python prototype of an app, that besides the internals making it up has a gui. While test-driven dev'ing the app's internals in Python is fun as usual, dev'ing the GUI is not so funny, at least for me. I guess dev'ing a GUI in a test-driven way is not possible, or is it? I'm using wxPython, so if anyone has an idea... For now most of the time I extend and change the gui things, then run it, do the clicks to go thru the...
1
2436
by: Danny Dy | last post by:
Hi To All, I always write My VBA code in SQL(see Example). Private Sub cbxAEName_NotInList(NewData As String, Response As Integer) Dim stSQL as String Dim strMsg As String strMsg = "'" & NewData & "' is not an available AE Name " & vbCrLf & vbCrLf
4
8441
by: simduss | last post by:
Hi, First of all, I'm a beginner with Unix. I have a "make" (Unix command) problem with a Pro*C sub-program since I installed Oracle8i (before I was at 7.3.4). I have a script builder that generate a makefile (that include env_precomp.mk) and launch this makefile after. So, I receive this error: make: 1254-002 Cannot find a rule to create target /u02/apps_r/dev/ben/lib/fcfz02.a from dependencies.
4
2111
by: KenFehling | last post by:
Hello. I am wondering if there exists a piece of software that takes multiple .js files that are nicely indented and commented and create one big tightly packed .js file. I'm hoping the one file would be less of a burden for the user's browser to download. I guess the final code output by this hypothetical program could maybe even just be on one long line unless that would create problems. Maybe there is some kind of optimal line...
0
1480
by: Gregory Gadow | last post by:
We have a number of development machines in our IT department, all running the same version of VS 2005 sp 1. Our company website and several compiled components were all written in VB.Net 2.0 using one of those machines, our "main dev." When I pull up the website in the VS IDE on that one machine, everything is fine. On any of the other machines, however, opening the website opens the site, then fills the Error List with just over a...
22
1268
by: bambam | last post by:
I have about 30 pages (10 * 3 pages each) of code like this (following). Can anyone suggest a more compact way to code the exception handling? If there is an exception, I need to continue the loop, and continue the list. Steve. ----------------------------------- for dev in devs try:
4
1936
by: David | last post by:
Hi list. Do test-driven development or behaviour-driven development advocate how to do higher-level testing than unit testing? types of testing: unit integration system
27
3060
by: Dave | last post by:
I'm having a hard time tying to build gcc 4.3.1 on Solaris using the GNU compilers. I then decided to try to use Sun's compiler. The Sun Studio 12 compiler reports the following code, which is in the source (gcc-4.3.1/gcc/c-common.c) of gcc 4.3.1, is a syntax error. I'm inclined to agree, as it is like no C I have ever met. what is "C_COMMON_FIXED_TYPES (, fract);" supposed to mean? Could it be
0
8469
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
8386
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8814
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
8592
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,...
0
7419
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4211
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
4391
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2042
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1794
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.