yf13 commented on PR #15444:
URL: https://github.com/apache/nuttx/pull/15444#issuecomment-2586225053
I removed the `const` modifier and tried on knsh64, also works:
```bash
$ git diff examples/hello
diff --git a/examples/hello/hello_main.c b/examples/hello/hello_main.c
index 2cd6cb400..270f3f453 100644
--- a/examples/hello/hello_main.c
+++ b/examples/hello/hello_main.c
@@ -28,6 +28,7 @@
/****************************************************************************
* Public Functions
****************************************************************************/
+static char *NAME = "NuttX";
/****************************************************************************
* hello_main
@@ -35,6 +36,6 @@
int main(int argc, FAR char *argv[])
{
- printf("Hello, World!!\n");
+ printf("Hello, World of %s!!\n", NAME);
return 0;
}
$ cd ../nuttx
$ qemu-system-riscv64 -M virt,aclint=on -semihosting -nographic -kernel nuttx
nsh> hello
Hello, World of NuttX!!
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]