Apart from error codes, error strings and logs, are there any other features which can be incorporated in the code to increase getting debug / trace information during code runtime which can help debug issues (or let us know what is going on) at runtime?
...
I know a little bit of C from high school and uni (mostly forgotten). I would like to learn C for Unix developemnt. I have a book of Dietel but there is not any information on how to use make, configure, Makefile and Posix API.
I would like to have some resources, books, web sites, PDF, anything, to get started. I want to use gnu tools....
I have core function which i can call from the customized module of the product.
function_core is the core function which will return and integer
we have a macro in header file
#define func_cust function_core
i am calling
func_cust inside my customized code.
EDIT: but inside the core we again call some other core function
#defin...
I have a .c file with the following
uint8_t buffer[32]
I have a .S file where I want to do the following
cpi r29, buffer+sizeof(buffer)
The second argument for cpi muste be an immediate value, not a location.
But unfortunately sizeof() is a C operator.
Both files are compiled to separate object files and linked together afterward...
Can optimizing compiler delete infinite loops, which does not changes any data, like
while(1)
/* noop */;
From analyzing a data flow graph compiler can derive, that such loop is "dead code" without any side effects.
Is deleting of infinite loops prohibited by C90/C99 standards?
Does C90 or C99 standards permit compiler to deletin...
I asked a question earlier on defining a structure using malloc.
This was the answer I was given by the majority:
struct retValue* st = malloc(sizeof(*st));
I was showing a friend my code, and we came to a stumbling block.
Could someone please explain why this code works?
From my viewpoint, *st hasn't been defined when you malloc it,...
I want to generate Full and Partially Call Trees from cscope database of c and c++ projects in Linux.
The project is rather large, so it can be not easy to work with the full call tree of project, so I want to limit call tree generation with grep-like filter of function names.
And also I want to be able to build "called by" and "called...
How do you initialize a 3d array in C++
int min[1][1][1] = {100, { 100, {100}}}; //this is not the way
...
i use devcpp and borland c compiler....
asm {
mov ax,4 // (I/O Func.)
mov bx,1 // (Output func)
mov cx,&name // (address of the string)
mov dx,6 // (lenght of the string)
int 0x21 // system call
}
in the above code snippets i want to print a string with the help of assembly language...
...
This can be a very simple question, I'm am attempting to debug an application which generates the following segfault error in the kern.log
kernel: myapp[15514]: segfault at 794ef0 ip 080513b sp 794ef0 error 6 in myapp[8048000+24000]
Here are my questions:
Is there any documentation as to what are the diff error numbers on segfault, ...
I know how to generate a core dump on OS X when a process crashes, but what I really need to do is attach to a process, generate a core dump, then resume that process (without killing it).
A long time ago (maybe a year and a half ago) I had C code that would do this... It used the OS X kernel libraries to connect to a process, read all...
Hi all,
I'm doing a bit of coursework for university and I'm completely baffled. Basically I've made a basic web server (which uses sockets) in C. I've now got to make it so that any .php file, is run through the php compiler and output.
The problem I'm having is that I've tried using system() and execlp() (the latter was recommended b...
Hi,
I see totally different behavior when running a piece of program that tries to exceed RSS on different machines. The code is something like:
...
char** s = (char**)malloc(10000*sizeof(char*));
for (i = 0; i < 10000; i++){
s[i] = (char*)malloc(1000*1000*sizeof(char));
if (s[i] == NULL) {
printf("cannot allocate me...
I'm looking for the Unix equivalent of Win32's CopyFile, I don't want to reinvent the wheel by writing my own version.
...
Is there a C function to find the second occurrence of sub-string in string?
i.e. String - "213 File status 550 Access Denied. 550 Access Denied."
This function would return "550 found twice"....
...
Hi, I have to read a large file containing many animation frames from CD/DVDrom and display it into screen as an animation. When reading from hard disk, the strategy of reading a frame into memory, processing, displaying and then reading next frame works good, but when I read from optical device, access time kills the animation.
I use ...
I am attempting to use the pipe interface to gnuplot (a standard one gnuplot_i.{cpp,hpp}) in order to generate a real time display of values that are continually changing within another program written in C++. This works ok but I wanted to see if anyone had any suggestions for improvement.
This implementation contains a convenience met...
Hi everybody,
Can someone explain how snd_pcm_writei
snd_pcm_sframes_t snd_pcm_writei(snd_pcm_t *pcm, const void *buffer,
snd_pcm_uframes_t size)
works?
I have used it like so:
for (int i = 0; i < 1; i++) {
f = snd_pcm_writei(handle, buffer, frames);
...
}
Full source code at http://pastebi...
Assuming the interpreter for the language (Can be anything from PHP to Ruby) is written in C.
How are variables (or more complex data structures not only containg name and value), which are defined by the script that is currently being executed, stored and read out?
I, with my rather poor knowledge of C, would end up with the conclusion...
Possible Duplicates:
Can you write object oriented code in C?
Object Oriented pattern in C ?
I remember reading a while ago about someone (I think it was Linus Torvalds) talking about how C++ is a horrible language and how you can write object-oriented programs with C. On having had time to reflect, I don't really see how al...