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

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\vulnerable.c" -o "C:\cCode\vulnerable.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\vulnerable.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\vulnerable.c:1:
C:/DEV-CPP/include/stdarg.h:6:2: warning: #include_next is a GCC
extension
In file included from C:\cCode\vulnerable.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\vulnerable.c:2:
C:/DEV-CPP/include/stddef.h:6:2: warning: #include_next is a GCC
extension
C:\cCode\vulnerable.c: In function `main':

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

Execution terminated
Compilation successful

Jun 16 '07 #1
4 2974
"waltbrad" <wa******@hotmail.comwrote in message
news:11**********************@o61g2000hsh.googlegr oups.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\vulnerable.c" -o "C:\cCode\vulnerable.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\vulnerable.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\vulnerable.c:1:
C:/DEV-CPP/include/stdarg.h:6:2: warning: #include_next is a GCC
extension
In file included from C:\cCode\vulnerable.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\vulnerable.c:2:
C:/DEV-CPP/include/stddef.h:6:2: warning: #include_next is a GCC
extension
C:\cCode\vulnerable.c: In function `main':

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

Execution terminated
Compilation successful
Umm.. "compilation 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.. "compilation 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.comwrote in message
news:Mc*************@newsfe7-win.ntli.net...

Umm.. "compilation 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:1999
or:
-std=gnu99 // C99 + GNU extensions

--
Bob R
POVrookie
Jun 16 '07 #4
On Jun 16, 11:26 am, waltbrad <waltb...@hotmail.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\vulnerable.c" -o "C:\cCode\vulnerable.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\vulnerable.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\vulnerable.c:1:
C:/DEV-CPP/include/stdarg.h:6:2: warning: #include_next is a GCC
extension
In file included from C:\cCode\vulnerable.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\vulnerable.c:2:
C:/DEV-CPP/include/stddef.h:6:2: warning: #include_next is a GCC
extension
C:\cCode\vulnerable.c: In function `main':

C:\cCode\vulnerable.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
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...
1
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 = "'" &...
4
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...
4
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...
0
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...
22
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...
4
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
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.