Theoritically there can't be a stack over flow in my scenario.
As per my knowledege, structure definition is cross checked and read during compilation, whether it is through header file or else...
Type: Posts; User: rk211083
Theoritically there can't be a stack over flow in my scenario.
As per my knowledege, structure definition is cross checked and read during compilation, whether it is through header file or else...
I tried that way, and actual issue got resolved.
But still wanted to figure out the possible reason as to why it works sometimes and not some other time.
Yes correct.
Now current this type of coding in our case was working fine since last say 1 year. But recently it started giving segmentation fault exactly at the point of structure variable...
What if flow goes as below:
def.c
struct STRUCT_ABC {
char *s;
double x;
};
void def() // Fine
So standard wise its fine.
Also, as per the example quoted in your reply, the structure with same name are present in both the c sources.
In my case, one of the instance of structure is defined in...
Thanks Grumpy for the info.
But how come it's working fine sometime, and throwing segmentation fault some other time. I suppose if its a standard violation, then it should always throw error or...
As per my query, the structure is defined not inside any function or main function.
Its specific to C source file and not any function.
Hi,
Is the below mentioned coding practice valid?
i. Declared one structure STRUCT_ABC in a header file abc.h
ii. Included abc.h in abc.c file and used STRUCT_ABC in some function inside abc.c....
The header file where same structure name is present is included in some other C sources under same project under which my particular C source is present. But not sure whether any of those sources...
Thanks for ur response.
Above declaration in my code is also correct, it works correctly.
While analysis, it was found that the structure name LOCAL_UTILS_STRUCT_TYPE was also present in one of...
Yes, I used dbx to find out the exact line.
While analysis, it was found that the structure name LOCAL_UTILS_STRUCT_TYPE was also present in one of the header files. But that header file is not...
I'm facing a segmentation fault(core) at the step where a structure variable is declared.
PFB the code snippet:
insert
struct LOCAL_UTILS_struct_
{
tbaAmtType bigLimitAmt;
...