mirror of
https://github.com/apache/nuttx.git
synced 2025-01-12 23:18:36 +08:00
Fix compilation errors
CC: gcov.c gcov.c: In function 'gcov_stdout_dump': gcov.c:146:50: error: passing argument 3 of '__gcov_info_to_gcda' from incompatible pointer type [-Werror=incompatible-pointer-types] 146 | __gcov_info_to_gcda(info, stdout_filename, stdout_dump, NULL, &arg); | ^~~~~~~~~~~ | | | void (*)(const void *, size_t, void *) {aka void (*)(const void *, long unsigned int, void *)} In file included from gcov.c:25: /mnt/vela/github/NX/nuttx/include/gcov.h:139:44: note: expected 'void (*)(const void *, unsigned int, void *)' but argument is of type 'void (*)(const void *, size_t, void *)' {aka 'void (*)(const void *, long unsigned int, void *)'} 139 | FAR void (*dump)(FAR const void *, | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~ 140 | unsigned int, FAR void *), | ~~~~~~~~~~~~~~~~~~~~~~~~~ libgcc/gcov.c: In function 'gcov_process_path.constprop': libgcc/gcov.c:235:29: error: 'filename' may be used uninitialized [-Werror=maybe-uninitialized] 235 | tokens[token_count++] = filename; | ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~ libgcc/gcov.c:189:13: note: 'filename' was declared here 189 | FAR char *filename; Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
This commit is contained in:
parent
d83ab55e00
commit
cdbf5c6ebe
2 changed files with 21 additions and 3 deletions
|
@ -137,7 +137,7 @@ extern void __gcov_info_to_gcda(FAR const struct gcov_info *info,
|
|||
FAR void (*filename)(FAR const char *,
|
||||
FAR void *),
|
||||
FAR void (*dump)(FAR const void *,
|
||||
unsigned int, FAR void *),
|
||||
size_t, FAR void *),
|
||||
FAR void *(*allocate)(unsigned int,
|
||||
FAR void *),
|
||||
FAR void *arg);
|
||||
|
|
|
@ -205,6 +205,11 @@ static int gcov_process_path(FAR char *prefix, int strip,
|
|||
|
||||
prefix_count = token_count;
|
||||
token = strtok(path, "/");
|
||||
if (token == NULL)
|
||||
{
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
while (token != NULL)
|
||||
{
|
||||
filename = token;
|
||||
|
@ -315,10 +320,23 @@ void __gcov_dump(void)
|
|||
FAR struct gcov_info *info;
|
||||
FAR const char *strip = getenv("GCOV_PREFIX_STRIP");
|
||||
FAR const char *prefix = getenv("GCOV_PREFIX");
|
||||
FAR char *prefix2 = strdup(prefix);
|
||||
FAR char new_path[PATH_MAX];
|
||||
FAR char *prefix2;
|
||||
int ret;
|
||||
|
||||
if (prefix == NULL)
|
||||
{
|
||||
syslog(LOG_ERR, "No path prefix specified");
|
||||
return;
|
||||
}
|
||||
|
||||
prefix2 = strdup(prefix);
|
||||
if (prefix2 == NULL)
|
||||
{
|
||||
syslog(LOG_ERR, "gcov alloc failed!");
|
||||
return;
|
||||
}
|
||||
|
||||
for (info = __gcov_info_start; info; info = info->next)
|
||||
{
|
||||
FAR char *filename;
|
||||
|
@ -401,7 +419,7 @@ void __gcov_filename_to_gcfn(FAR const char *filename,
|
|||
void __gcov_info_to_gcda(FAR const struct gcov_info *info,
|
||||
FAR void (*filename_fn)(FAR const char *,
|
||||
FAR void *),
|
||||
FAR void (*dump_fn)(FAR const void *, unsigned int,
|
||||
FAR void (*dump_fn)(FAR const void *, size_t,
|
||||
FAR void *),
|
||||
FAR void *(*allocate_fn)(unsigned int, FAR void *),
|
||||
FAR void *arg)
|
||||
|
|
Loading…
Reference in a new issue