GNOME Bugzilla – Bug 792713
[PATCH] Don't put #include "stdio.h" inside the main function
Last modified: 2018-01-27 09:00:01 UTC
Please see tha patch. Putting includes in the second argument of AC_LANG_PROGRAM causes headers to be included inside the main function. This fails on compilers not supporting nested functions because stdio.h may have definitions of inline functions. clang: error: function definition is not allowed here
Created attachment 367135 [details] [review] configure: Don't put includes in function body of AC_LANG_PROGRAM (tracker) The second argument of AC_LANG_PROGRAM is the content of main function. We cannot put any includes there, or we end up testing whether the compiler supports nested functions because headers may have definitions for inline functions.
Created attachment 367136 [details] [review] configure: Don't put includes in function body of AC_LANG_PROGRAM (tracker-miners) The second argument of AC_LANG_PROGRAM is the content of main function. We cannot put any includes there, or we end up testing whether the compiler supports nested functions because headers may have definitions for inline functions.
Comment on attachment 367135 [details] [review] configure: Don't put includes in function body of AC_LANG_PROGRAM (tracker) Right.
Comment on attachment 367136 [details] [review] configure: Don't put includes in function body of AC_LANG_PROGRAM (tracker-miners) This one too.
Thanks for the patches! Feel free to push :).
Comment on attachment 367135 [details] [review] configure: Don't put includes in function body of AC_LANG_PROGRAM (tracker) Attachment 367135 [details] pushed as 2d5fb36 - configure: Don't put includes in function body of AC_LANG_PROGRAM
Attachment 367136 [details] pushed as b70291d - configure: Don't put includes in function body of AC_LANG_PROGRAM