Consider the following C program: double foo (double); /* Line 1 */ int main()…
GATE · 2005 · CS
Consider the following C program:
double foo (double); /* Line 1 */
int main()
{
double da, db;
// input da
db = foo(da);
}
double foo(double a)
{
return a;
}
Assume the program is compiled in ISO C17 mode with GCC 14 or later, or Clang 16 or later, using default diagnostic severity. If Line 1 is deleted, which result best describes the compilation?
- A.
no compile warning or error
- B.
some compiler warnings not leading to unintended results
- C.
some compiler warnings due to a type mismatch, eventually leading to unintended results
- D.
compilation fails with compiler errors
Attempted by 521 students.
Sign up free to check your answer
Sign up freeLoading lesson…