Skip to content

ISO C++11 / conversion from string literal to 'char * (unit test files) #208

@djb-rwth

Description

@djb-rwth

Probably known reporting it anyway.
Same issues in three files related to unit tests.
Try const char * or strdup.

In file included from /src/inchi/INCHI-1-TEST/tests/test_unit/test_ichiprt1.cpp:13:
/src/inchi/INCHI-1-TEST/tests/test_unit/../../../INCHI-1-SRC/INCHI_BASE/src/strutil.c:8062:13: warning: ISO C++11 does not allow conversion from string literal to 'char *'
      [-Wwritable-strings]
 8062 |     ITRACE_("\n\n*********************************************************************\n* Subgraf:");
      |             ^
/src/inchi/INCHI-1-TEST/tests/test_unit/../../../INCHI-1-SRC/INCHI_BASE/src/strutil.c:8063:13: warning: ISO C++11 does not allow conversion from string literal to 'char *'
      [-Wwritable-strings]
 8063 |     ITRACE_("\n\tNodes: %-d ( ", sg->nnodes);
      |             ^
/src/inchi/INCHI-1-TEST/tests/test_unit/../../../INCHI-1-SRC/INCHI_BASE/src/strutil.c:8066:17: warning: ISO C++11 does not allow conversion from string literal to 'char *'
      [-Wwritable-strings]
 8066 |         ITRACE_("%-d ", sg->nodes[p]);
      |                 ^
/src/inchi/INCHI-1-TEST/tests/test_unit/../../../INCHI-1-SRC/INCHI_BASE/src/strutil.c:8068:13: warning: ISO C++11 does not allow conversion from string literal to 'char *'
      [-Wwritable-strings]
 8068 |     ITRACE_(")\n\tAdj lists:\n");
      |             ^
/src/inchi/INCHI-1-TEST/tests/test_unit/../../../INCHI-1-SRC/INCHI_BASE/src/strutil.c:8071:17: warning: ISO C++11 does not allow conversion from string literal to 'char *'
      [-Wwritable-strings]
 8071 |         ITRACE_("\tNode #%-d (orig# %-d) ::: Neighbors (node#, orig#) : ",
      |                 ^
/src/inchi/INCHI-1-TEST/tests/test_unit/../../../INCHI-1-SRC/INCHI_BASE/src/strutil.c:8076:21: warning: ISO C++11 does not allow conversion from string literal to 'char *'
      [-Wwritable-strings]
 8076 |             ITRACE_("(%-d/%-d/%-d)  ", nbr, sg->nodes[nbr]);
      |                     ^
/src/inchi/INCHI-1-TEST/tests/test_unit/../../../INCHI-1-SRC/INCHI_BASE/src/strutil.c:8078:17: warning: ISO C++11 does not allow conversion from string literal to 'char *'
      [-Wwritable-strings]
 8078 |         ITRACE_("\n");
      |                 ^
/src/inchi/INCHI-1-TEST/tests/test_unit/../../../INCHI-1-SRC/INCHI_BASE/src/strutil.c:8080:13: warning: ISO C++11 does not allow conversion from string literal to 'char *'
      [-Wwritable-strings]
 8080 |     ITRACE_("\n* End Subgraf\n*********************************************************************\n");
      |             ^
/src/inchi/INCHI-1-TEST/tests/test_unit/../../../INCHI-1-SRC/INCHI_BASE/src/strutil.c:8184:21: warning: ISO C++11 does not allow conversion from string literal to 'char *'
      [-Wwritable-strings]
 8184 |             ITRACE_("\n\tFound path (in orig atom numbers):\t");
      |                     ^
/src/inchi/INCHI-1-TEST/tests/test_unit/../../../INCHI-1-SRC/INCHI_BASE/src/strutil.c:8188:25: warning: ISO C++11 does not allow conversion from string literal to 'char *'
      [-Wwritable-strings]
 8188 |                 ITRACE_("%-d ", orig_atnum);
      |                         ^
/src/inchi/INCHI-1-TEST/tests/test_unit/../../../INCHI-1-SRC/INCHI_BASE/src/strutil.c:8194:21: warning: ISO C++11 does not allow conversion from string literal to 'char *'
      [-Wwritable-strings]
 8194 |             ITRACE_("\t( In node nums: ");
      |                     ^
/src/inchi/INCHI-1-TEST/tests/test_unit/../../../INCHI-1-SRC/INCHI_BASE/src/strutil.c:8201:25: warning: ISO C++11 does not allow conversion from string literal to 'char *'
      [-Wwritable-strings]
 8201 |                 ITRACE_("%-d ", spf->seen[k]);
      |                         ^
/src/inchi/INCHI-1-TEST/tests/test_unit/../../../INCHI-1-SRC/INCHI_BASE/src/strutil.c:8203:21: warning: ISO C++11 does not allow conversion from string literal to 'char *'
      [-Wwritable-strings]
 8203 |             ITRACE_(")");
      |                     ^
13 warnings generated.
In file included from /src/inchi/INCHI-1-TEST/tests/test_unit/test_ichiprt1_enhancedStereo.cpp:13:
/src/inchi/INCHI-1-TEST/tests/test_unit/../../../INCHI-1-SRC/INCHI_BASE/src/strutil.c:8062:13: warning: ISO C++11 does not allow conversion from string literal to 'char *'
      [-Wwritable-strings]
 8062 |     ITRACE_("\n\n*********************************************************************\n* Subgraf:");
      |             ^
/src/inchi/INCHI-1-TEST/tests/test_unit/../../../INCHI-1-SRC/INCHI_BASE/src/strutil.c:8063:13: warning: ISO C++11 does not allow conversion from string literal to 'char *'
      [-Wwritable-strings]
 8063 |     ITRACE_("\n\tNodes: %-d ( ", sg->nnodes);
      |             ^
/src/inchi/INCHI-1-TEST/tests/test_unit/../../../INCHI-1-SRC/INCHI_BASE/src/strutil.c:8066:17: warning: ISO C++11 does not allow conversion from string literal to 'char *'
      [-Wwritable-strings]
 8066 |         ITRACE_("%-d ", sg->nodes[p]);
      |                 ^
/src/inchi/INCHI-1-TEST/tests/test_unit/../../../INCHI-1-SRC/INCHI_BASE/src/strutil.c:8068:13: warning: ISO C++11 does not allow conversion from string literal to 'char *'
      [-Wwritable-strings]
 8068 |     ITRACE_(")\n\tAdj lists:\n");
      |             ^
/src/inchi/INCHI-1-TEST/tests/test_unit/../../../INCHI-1-SRC/INCHI_BASE/src/strutil.c:8071:17: warning: ISO C++11 does not allow conversion from string literal to 'char *'
      [-Wwritable-strings]
 8071 |         ITRACE_("\tNode #%-d (orig# %-d) ::: Neighbors (node#, orig#) : ",
      |                 ^
/src/inchi/INCHI-1-TEST/tests/test_unit/../../../INCHI-1-SRC/INCHI_BASE/src/strutil.c:8076:21: warning: ISO C++11 does not allow conversion from string literal to 'char *'
      [-Wwritable-strings]
 8076 |             ITRACE_("(%-d/%-d/%-d)  ", nbr, sg->nodes[nbr]);
      |                     ^
/src/inchi/INCHI-1-TEST/tests/test_unit/../../../INCHI-1-SRC/INCHI_BASE/src/strutil.c:8078:17: warning: ISO C++11 does not allow conversion from string literal to 'char *'
      [-Wwritable-strings]
 8078 |         ITRACE_("\n");
      |                 ^
/src/inchi/INCHI-1-TEST/tests/test_unit/../../../INCHI-1-SRC/INCHI_BASE/src/strutil.c:8080:13: warning: ISO C++11 does not allow conversion from string literal to 'char *'
      [-Wwritable-strings]
 8080 |     ITRACE_("\n* End Subgraf\n*********************************************************************\n");
      |             ^
/src/inchi/INCHI-1-TEST/tests/test_unit/../../../INCHI-1-SRC/INCHI_BASE/src/strutil.c:8184:21: warning: ISO C++11 does not allow conversion from string literal to 'char *'
      [-Wwritable-strings]
 8184 |             ITRACE_("\n\tFound path (in orig atom numbers):\t");
      |                     ^
/src/inchi/INCHI-1-TEST/tests/test_unit/../../../INCHI-1-SRC/INCHI_BASE/src/strutil.c:8188:25: warning: ISO C++11 does not allow conversion from string literal to 'char *'
      [-Wwritable-strings]
 8188 |                 ITRACE_("%-d ", orig_atnum);
      |                         ^
/src/inchi/INCHI-1-TEST/tests/test_unit/../../../INCHI-1-SRC/INCHI_BASE/src/strutil.c:8194:21: warning: ISO C++11 does not allow conversion from string literal to 'char *'
      [-Wwritable-strings]
 8194 |             ITRACE_("\t( In node nums: ");
      |                     ^
/src/inchi/INCHI-1-TEST/tests/test_unit/../../../INCHI-1-SRC/INCHI_BASE/src/strutil.c:8201:25: warning: ISO C++11 does not allow conversion from string literal to 'char *'
      [-Wwritable-strings]
 8201 |                 ITRACE_("%-d ", spf->seen[k]);
      |                         ^
/src/inchi/INCHI-1-TEST/tests/test_unit/../../../INCHI-1-SRC/INCHI_BASE/src/strutil.c:8203:21: warning: ISO C++11 does not allow conversion from string literal to 'char *'
      [-Wwritable-strings]
 8203 |             ITRACE_(")");
      |                     ^
13 warnings generated.
In file included from /src/inchi/INCHI-1-TEST/tests/test_unit/test_ichiprt3.cpp:7:
/src/inchi/INCHI-1-TEST/tests/test_unit/../../../INCHI-1-SRC/INCHI_BASE/src/strutil.c:8062:13: warning: ISO C++11 does not allow conversion from string literal to 'char *'
      [-Wwritable-strings]
 8062 |     ITRACE_("\n\n*********************************************************************\n* Subgraf:");
      |             ^
/src/inchi/INCHI-1-TEST/tests/test_unit/../../../INCHI-1-SRC/INCHI_BASE/src/strutil.c:8063:13: warning: ISO C++11 does not allow conversion from string literal to 'char *'
      [-Wwritable-strings]
 8063 |     ITRACE_("\n\tNodes: %-d ( ", sg->nnodes);
      |             ^
/src/inchi/INCHI-1-TEST/tests/test_unit/../../../INCHI-1-SRC/INCHI_BASE/src/strutil.c:8066:17: warning: ISO C++11 does not allow conversion from string literal to 'char *'
      [-Wwritable-strings]
 8066 |         ITRACE_("%-d ", sg->nodes[p]);
      |                 ^
/src/inchi/INCHI-1-TEST/tests/test_unit/../../../INCHI-1-SRC/INCHI_BASE/src/strutil.c:8068:13: warning: ISO C++11 does not allow conversion from string literal to 'char *'
      [-Wwritable-strings]
 8068 |     ITRACE_(")\n\tAdj lists:\n");
      |             ^
/src/inchi/INCHI-1-TEST/tests/test_unit/../../../INCHI-1-SRC/INCHI_BASE/src/strutil.c:8071:17: warning: ISO C++11 does not allow conversion from string literal to 'char *'
      [-Wwritable-strings]
 8071 |         ITRACE_("\tNode #%-d (orig# %-d) ::: Neighbors (node#, orig#) : ",
      |                 ^
/src/inchi/INCHI-1-TEST/tests/test_unit/../../../INCHI-1-SRC/INCHI_BASE/src/strutil.c:8076:21: warning: ISO C++11 does not allow conversion from string literal to 'char *'
      [-Wwritable-strings]
 8076 |             ITRACE_("(%-d/%-d/%-d)  ", nbr, sg->nodes[nbr]);
      |                     ^
/src/inchi/INCHI-1-TEST/tests/test_unit/../../../INCHI-1-SRC/INCHI_BASE/src/strutil.c:8078:17: warning: ISO C++11 does not allow conversion from string literal to 'char *'
      [-Wwritable-strings]
 8078 |         ITRACE_("\n");
      |                 ^
/src/inchi/INCHI-1-TEST/tests/test_unit/../../../INCHI-1-SRC/INCHI_BASE/src/strutil.c:8080:13: warning: ISO C++11 does not allow conversion from string literal to 'char *'
      [-Wwritable-strings]
 8080 |     ITRACE_("\n* End Subgraf\n*********************************************************************\n");
      |             ^
/src/inchi/INCHI-1-TEST/tests/test_unit/../../../INCHI-1-SRC/INCHI_BASE/src/strutil.c:8184:21: warning: ISO C++11 does not allow conversion from string literal to 'char *'
      [-Wwritable-strings]
 8184 |             ITRACE_("\n\tFound path (in orig atom numbers):\t");
      |                     ^
/src/inchi/INCHI-1-TEST/tests/test_unit/../../../INCHI-1-SRC/INCHI_BASE/src/strutil.c:8188:25: warning: ISO C++11 does not allow conversion from string literal to 'char *'
      [-Wwritable-strings]
 8188 |                 ITRACE_("%-d ", orig_atnum);
      |                         ^
/src/inchi/INCHI-1-TEST/tests/test_unit/../../../INCHI-1-SRC/INCHI_BASE/src/strutil.c:8194:21: warning: ISO C++11 does not allow conversion from string literal to 'char *'
      [-Wwritable-strings]
 8194 |             ITRACE_("\t( In node nums: ");
      |                     ^
/src/inchi/INCHI-1-TEST/tests/test_unit/../../../INCHI-1-SRC/INCHI_BASE/src/strutil.c:8201:25: warning: ISO C++11 does not allow conversion from string literal to 'char *'
      [-Wwritable-strings]
 8201 |                 ITRACE_("%-d ", spf->seen[k]);
      |                         ^
/src/inchi/INCHI-1-TEST/tests/test_unit/../../../INCHI-1-SRC/INCHI_BASE/src/strutil.c:8203:21: warning: ISO C++11 does not allow conversion from string literal to 'char *'
      [-Wwritable-strings]
 8203 |             ITRACE_(")");
      |                     ^
13 warnings generated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions