When compiling with gcc on Linux, I get the following errors:
com bar.c
bar.c: In function ‘main’:
bar.c:28:38: error: ‘program_invocation_short_name’ undeclared (first use in this function)
...
Type: Posts; User: rstanley
When compiling with gcc on Linux, I get the following errors:
com bar.c
bar.c: In function ‘main’:
bar.c:28:38: error: ‘program_invocation_short_name’ undeclared (first use in this function)
...
We would need more information about what you are trying to do. Do you have any code yet?
You may also want to check out this latest article on the Static Code Analysis options being added to gcc 14, or already added to the current gcc compiler.
Check out all the gcc options,...
This is a forum for the C Programming Language. We cannot give you answers to Windows specific questions.
You need to post this in the Windows forum on this site.
That would depend on the O/S. Please check this article for multiple O/S's.
Also, you could use ncurses.
You are not being "Old Fashioned"! Just stick to using the Standard C Library and your code will be very portable. Avoid most, if not all of the compiler specific extension functions!
C is for...
Actually, there is one minor correction I would make besides the my other reccmendations:
printf("%u is not betweem 1 and %u.\n", count, MAXNUMS);
// Should be:
printf("%u is not betweem 1...
BillMcEnaney:
IMHO, No.
splint is outdated and has too many "False Positives". Apparently it has not been updated since 2007, prior to the C11 and C17 C Standards were published!
...
strcat() is a C Standard Library function. As such, the prototype for this and all other C Standard Library functions, will be the same on Windows, Linux, UNIX, MacOS, and all other Standards...
Please make sure that you post code that will compile on someone else's computer!
"EMPTY;" should be replaced with a simple standard, ';' Everyone knows what that means!
$is_null(dst) Not...
If you are capturing the output from output functions just to prevent messages from splint, don't waste your time! use:
splint -retvalint ./source_file.c
You should be checking the return...
Your "memory leak" is erroneous! If you are on Linux, you could run valgrind. Splint is not that reliable, IMHO. I consider splint report of a memory leak as a false positive.
I would also...
Yes, it is possible.
If you are talking about defining your version of strcat(), how would you approach it? If you didn't use pointers how would you write it? How would you then implement it...
Seriously? strcat() does use pointers to both the source and destination! In a browser enter, "https://man7.org/linux/man-pages/man3/strcat.3p.html" and read the details presented there!
...
Did you "#include <stdio.h>" that declares the function, fileno().
MIPS cross compile with gcc.
I don't use MIPS.
Simple:
$ gcc -S divide.c
// divide.s
.file "divide.c"
.text
.globl divide
You should have all the information you need to answer these questions. Visit your library and borrow a good book on the C Programming language, if you don't want to buy one.
Look at the...
"const" and "volatile" are NOT data types!
The keyword volatile should not be used, especially for a beginning programmer, that has not studied a good book on the C Language!
const prevents a...
#include <stdio.h>
int uvar; // Unitialized global variable, stored in the bss data segment
int ivar = 10; // Initialized global variable, stored in the global data segment...
That article is pretty clear, what is not clear for you?
All static variables, both local and global, along with all global variables are located in the data segments. Static local variables are...
I would avoid assembler code completely and see if the article I gave you has a better solution for your needs.
IMHO!
I am away from my computer for the rest of the day. Perhaps someone else can assist you further.
Take a look at this page: Use compiler flags for stack protection in GCC and Clang | Red Hat Developer
That is your job! I can't do all the work for you! ;^)