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...
Type: Posts; User: rstanley
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! ;^)
You should be able to view the stack through a debugger such as gdb. Check the documentation for gdb.
I have never done any stack tracking, using the current program stack, though there may be a way to do it.
As for converting code to assembly, you can do it with "gcc -S hello.c". You can...
If you are so concerned about blowing the stack using recursion, then change the algorithm to avoid recursion. Don't try to track the stack!
Adding function calls within the recursive function...
This would seem to be a compiler/O/S implementation problem. Under Debian Linux, I see no difference, using gcc on the command line, with or without initialization, and should not see any...
There is no way for a poster to delete a post. On the contrary, it helps other readers who might have similar issues, or just use the post to further their knowledge of the C Language.
There are so many problems and complexity with this program!
Why do you not use strlen() from the string.h header file???
I have renamed your function so it does not conflict with the Standard...
At the bottom of each posting, there are two buttons, "Reply" and "Reply With Quote". Just use "Reply".
Plus there is an open box at the bottom, "Quick Reply" that is always present.
For starters, strcopy() should called strconcat() as you are attempting to concatinate two strings in the function.
You have declared "both" as an uninitialized pointer, and have not allocated any...
In my previous post:
should be:
The hardware controls how many bits are in a byte, and yes, there may be some systems where the byte has more than 8 bits.
In C, there is no difference between a char and a byte, other than there...