Can type qualifiers be added through declarations
For example, I have one variable defined in file scope without type
qualifier. In another file, say f1.c, this variable is declared with
two qualifiers added, and in the third file f2.c, declared with only
one qualifier added.
Will the variable act just as what they are declared in each file? Is
it a const and volatile variable in f1.c and only volatile in f2.c?
/* definition.c
************************************************** *************/
/*no qualifier added*/
int g_value = 0;
/* f1.c
************************************************** *********************/
int f1(void)
{
/*two qualifiers added: volatile, const*/
extern int volatile const g_value;
/*...*/
return 0;
}
/* f2.c
************************************************** *********************/
int f2(void)
{
/*one qualifiers added: volatile*/
extern int volatile g_value;
/*...*/
return 0;
}
Thank you for your time.