FR: Cy_SCB_UART_PutArrayBlocking should take const pointer

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
NiLe_4796031
Level 2
Level 2
10 replies posted 5 replies posted 5 questions asked

Currently Cy_SCB_UART_PutArrayBlocking takes a "void * buffer" to point to the data to output. Is it possible that it will write through this pointer? I would like to use a dynamically chosen pointer to constant data. Presently I get a warning from GCC when doing that, "passing 'const char *' to parameter of type 'void *' discards qualifiers" the qualifier being "const".

0 Likes
1 Solution
ShipingW_81
Moderator
Moderator
Moderator
500 replies posted 250 solutions authored 250 replies posted

It looks it's fine to pass a constant data to type 'void *'. Any issue to do this on your side?

View solution in original post

0 Likes
3 Replies
ShipingW_81
Moderator
Moderator
Moderator
500 replies posted 250 solutions authored 250 replies posted

It looks it's fine to pass a constant data to type 'void *'. Any issue to do this on your side?

0 Likes

It appears to work in my code, but I'm getting a compiler warnings each time, which is drowning out other compiler warnings. It'd be nice if Cypress could add a 'const' to that declaration in the next release of the PDL. Thanks!

0 Likes
Roy_Liu
Moderator
Moderator
Moderator
5 comments on KBA First comment on KBA 10 questions asked

We will report this issue to the development team.

Roy Liu