This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new b8561558e7 sched: Improve Kconfig help of INIT_ENTRYPOINT
b8561558e7 is described below

commit b8561558e753fcf7408a28878028109c47c0f90b
Author: Nathan Hartman <{ID}+{username}@users.noreply.github.com>
AuthorDate: Sun Jul 21 11:56:41 2024 -0400

    sched: Improve Kconfig help of INIT_ENTRYPOINT
    
    * sched/Kconfig
      (INIT_ENTRYPOINT): Document that the signature of "main" must take
       "argc" and "argv" or else compilation error results, as discussed in
       the email thread below [1].
    
    References:
    
    [1] [email protected] email thread:
        "basically, I get an error when I do make" started 18 Jul 2024,
        archived:
        https://lists.apache.org/thread/9j2s3647ysdhy204g4ombn4o09bn11c1
        and elsewhere.
---
 sched/Kconfig | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/sched/Kconfig b/sched/Kconfig
index 1601dbcd53..09c3ac08f4 100644
--- a/sched/Kconfig
+++ b/sched/Kconfig
@@ -445,6 +445,20 @@ config INIT_ENTRYPOINT
                applications this is of the form 'app_main' where 'app' is the 
application
                name. If not defined, INIT_ENTRYPOINT defaults to "main".
 
+               Note that main must take "argc" and "argv" arguments:
+
+               int main(int argc, FAR char *argv[])
+
+               Otherwise, if using a signature such as "int main(void)" a 
compilation
+               error will result:
+
+               > $ make
+               > CC:  CustomHello.c <command-line>: error: conflicting types 
for
+               > 'custom_hello_main'
+               > CustomHello.c:3:5: note: in expansion of macro 'main'
+               >     3 | int main(void)
+               >       |     ^~~~
+
 config INIT_ENTRYNAME
        string "Application entry name"
        default INIT_ENTRYPOINT

Reply via email to