You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@mynewt.apache.org by "Marko Kiiskila (JIRA)" <ji...@apache.org> on 2017/02/28 19:42:45 UTC
[jira] [Closed] (MYNEWT-435) Incorrect usage of CONF_VALUE_SET with
string variable
[ https://issues.apache.org/jira/browse/MYNEWT-435?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Marko Kiiskila closed MYNEWT-435.
---------------------------------
Resolution: Not A Problem
This is not an issue.
The name of an array evaluates to the address of the first element of the array, so array and &array have the same value.
Try this:
#include <stdio.h>
int
main(int argc, char **argv)
{
char array[32];
printf("%p %p\n", array, &array);
return 0;
}
[marko@IsMyLaptop:~/test]$ ./array_addr
0x7fff54f8f930 0x7fff54f8f930
> Incorrect usage of CONF_VALUE_SET with string variable
> ------------------------------------------------------
>
> Key: MYNEWT-435
> URL: https://issues.apache.org/jira/browse/MYNEWT-435
> Project: Mynewt
> Issue Type: Bug
> Affects Versions: v0_9_0
> Reporter: hathach
> Assignee: Marko Kiiskila
>
> In app/slinky line 172
> https://github.com/apache/incubator-mynewt-core/blob/master/apps/slinky/src/main.c#L172
> CONF_VALUE_SET(val, CONF_STRING, test_str) will be expanded to
> conf_value_from_str((val), (CONF_STRING), &(test_str), sizeof(test_str)).
> test_str should be passed instead of &test_str since it is declared as char array.
> Similarly there is other few places
> - https://github.com/apache/incubator-mynewt-core/blob/master/sys/id/src/id.c#L83
> - https://github.com/apache/incubator-mynewt-core/blob/master/sys/reboot/src/log_reboot.c#L186
> - https://github.com/apache/incubator-mynewt-core/blob/master/sys/reboot/src/log_reboot.c#L193
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)