[ 
https://issues.apache.org/jira/browse/MINIFICPP-638?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16653262#comment-16653262
 ] 

ASF GitHub Bot commented on MINIFICPP-638:
------------------------------------------

Github user arpadboda commented on a diff in the pull request:

    https://github.com/apache/nifi-minifi-cpp/pull/417#discussion_r225851325
  
    --- Diff: libminifi/include/capi/cstructs.h ---
    @@ -86,11 +86,16 @@ typedef struct {
      */
     
     typedef struct {
    -  char *key;
    +  const char *key;
    --- End diff --
    
    The problem here is without the const specifier you can't write the 
following:
    ```
    key = "some text"
    ```
    As you end up with a non-const pointer to a string literal. This is pretty 
error-prone as well as any modification on that will compile, but most probably 
lead to a bus error or sg. alike. 


> C API: add unit tests
> ---------------------
>
>                 Key: MINIFICPP-638
>                 URL: https://issues.apache.org/jira/browse/MINIFICPP-638
>             Project: NiFi MiNiFi C++
>          Issue Type: Sub-task
>            Reporter: Arpad Boda
>            Assignee: Arpad Boda
>            Priority: Minor
>             Fix For: 0.6.0
>
>
> Add some C API unit tests. 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to