diff mbox series

sdk: The main in the C example should return an int

Message ID 20250808174828.236218-1-jan.vermaete@gmail.com
State New
Headers show
Series sdk: The main in the C example should return an int | expand

Commit Message

Jan Vermaete Aug. 8, 2025, 5:48 p.m. UTC
see C17 (ISO/IEC 9899:2018)

Signed-off-by: Jan Vermaete <jan.vermaete@gmail.com>
---
 documentation/sdk-manual/working-projects.rst | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Khem Raj Aug. 9, 2025, 2:47 a.m. UTC | #1
On Fri, Aug 8, 2025 at 10:48 AM Jan Vermaete via
lists.yoctoproject.org <jan.vermaete=gmail.com@lists.yoctoproject.org>
wrote:
>
> see C17 (ISO/IEC 9899:2018)
>
> Signed-off-by: Jan Vermaete <jan.vermaete@gmail.com>
> ---
>  documentation/sdk-manual/working-projects.rst | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/documentation/sdk-manual/working-projects.rst b/documentation/sdk-manual/working-projects.rst
> index 4236bcec2..7df73b1b1 100644
> --- a/documentation/sdk-manual/working-projects.rst
> +++ b/documentation/sdk-manual/working-projects.rst
> @@ -56,9 +56,10 @@ project:
>
>           #include <stdio.h>
>
> -         main()
> +         int main()
>               {
>                   printf("Hello World!\n");
> +                 return 0;
>               }
>


I will go a step further

#include <stdio.h>

int main(void) {
    printf("Hello World!\n");
    return 0;
}

int main(void) explicitly states the function takes no parameters

>     -  ``configure.ac``::
> --
> 2.39.5
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#7446): https://lists.yoctoproject.org/g/docs/message/7446
> Mute This Topic: https://lists.yoctoproject.org/mt/114604610/1997914
> Group Owner: docs+owner@lists.yoctoproject.org
> Unsubscribe: https://lists.yoctoproject.org/g/docs/unsub [raj.khem@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
diff mbox series

Patch

diff --git a/documentation/sdk-manual/working-projects.rst b/documentation/sdk-manual/working-projects.rst
index 4236bcec2..7df73b1b1 100644
--- a/documentation/sdk-manual/working-projects.rst
+++ b/documentation/sdk-manual/working-projects.rst
@@ -56,9 +56,10 @@  project:
 
          #include <stdio.h>
 
-         main()
+         int main()
              {
                  printf("Hello World!\n");
+                 return 0;
              }
 
    -  ``configure.ac``::