diff --git a/doc/releases/release-notes-3.4.rst b/doc/releases/release-notes-3.4.rst index 126029acfc8..48b782747ef 100644 --- a/doc/releases/release-notes-3.4.rst +++ b/doc/releases/release-notes-3.4.rst @@ -129,6 +129,17 @@ Changes in this release * Touchscreen drivers converted to use the input APIs can use the :dtcompatible:`zephyr,kscan-input` driver to maintain Kscan compatilibity. +* The declaration of :c:func:`main` has been changed from ``void + main(void)`` to ``int main(void)``. The main function is required to + return the value zero. All other return values are reserved. This aligns + Zephyr with the C and C++ language specification requirements for + "hosted" environments, avoiding compiler warnings and errors. These + compiler messages are generated when applications are built in "hosted" + mode (which means without the ``-ffreestanding`` compiler flag). As the + ``-ffreestanding`` flag is currently enabled unless the application is + using picolibc, only applications using picolibc will be affected by this + change at this time. + Removed APIs in this release ============================ diff --git a/samples/hello_world/src/main.c b/samples/hello_world/src/main.c index bc7a4c1d716..133ddd5048f 100644 --- a/samples/hello_world/src/main.c +++ b/samples/hello_world/src/main.c @@ -6,8 +6,8 @@ #include -int main(void) +void main(void) { printk("Hello World! %s\n", CONFIG_BOARD); - return 0; + return; }