Changeset 94d5b6ea in rtems

Timestamp:
09/10/19 10:48:24 (5 years ago)
Author:
Luc Michel <luc.michel@…>
Branches:
5, master
Children:
7217a4f
Parents:
39f64e08
git-author:
Luc Michel <luc.michel@…> (09/10/19 10:48:24)
git-committer:
Sebastian Huber <sebastian.huber@…> (03/02/20 06:52:20)
Message:

libfdt.h: add explicit cast from void* to uint8_t* in fdt(32|64)_st

Including libfdt.h in a C++ project fails during compilation with recent
version of GCC or Clang.

This simple example:

extern "C" {

#include <libfdt.h>

}

int main(void) { return 0; }

leads to the following errors with GCC 9.1.0:

/usr/include/libfdt.h: In function ‘void fdt32_st(void*, uint32_t)’:
/usr/include/libfdt.h:139:16: error: invalid conversion from ‘void*’ to ‘uint8_t*’ {aka ‘unsigned char*’} [-fpermissive]

139 | uint8_t *bp = property;

| ~
| |
| void*

/usr/include/libfdt.h: In function ‘void fdt64_st(void*, uint64_t)’:
/usr/include/libfdt.h:163:16: error: invalid conversion from ‘void*’ to ‘uint8_t*’ {aka ‘unsigned char*’} [-fpermissive]

163 | uint8_t *bp = property;

| ~
| |
| void*

This commit adds an explicit cast to uint8_t* to fix this issue.

Signed-off-by: Luc Michel <luc.michel@…>
Message-Id: <20190910104824.1321594-1-luc.michel@…>
Signed-off-by: David Gibson <david@…>

(No files)

Note: See TracChangeset for help on using the changeset viewer.