Ticket #119 (closed task: fixed)

Opened 2 years ago

Last modified 7 days ago

Boost string conversion warning

Reported by: daniel Owned by: anton
Priority: minor Milestone: Version 1.1
Component: pgRouting package Version: trunk
Keywords: Cc:

Description

Just upgraded to PostgreSQL 8.3 on my Ubuntu PC and wanted to compile the trunk version of pgRouting. Boost wrapper always gave me a warning: "Warnung: veraltete Konvertierung von Zeichenkettenkonstante in »char*«" That means something like "Warning: outdated conversion of string constants in »char*«"

Because there are so many of those warnings, would be nice to get rid of them. Looks better ;-) I don't know it's a difficult task or not.

daniel@bougainvilla:/opt/workspace/pgRouting$ make
Scanning dependencies of target routing
[ 16%] Building C object core/src/CMakeFiles/routing.dir/dijkstra.o
[ 33%] Building C object core/src/CMakeFiles/routing.dir/astar.o
[ 50%] Building C object core/src/CMakeFiles/routing.dir/shooting_star.o
[ 66%] Building CXX object core/src/CMakeFiles/routing.dir/boost_wrapper.o
/opt/workspace/pgRouting/core/src/boost_wrapper.cpp: In function »int boost_dijkstra(edge_t*, unsigned int, int, int, bool, bool, path_element_t**, int*, char**)«:
/opt/workspace/pgRouting/core/src/boost_wrapper.cpp:108: Warnung: veraltete Konvertierung von Zeichenkettenkonstante in »char*«
/opt/workspace/pgRouting/core/src/boost_wrapper.cpp:115: Warnung: veraltete Konvertierung von Zeichenkettenkonstante in »char*«
/opt/workspace/pgRouting/core/src/boost_wrapper.cpp:134: Warnung: veraltete Konvertierung von Zeichenkettenkonstante in »char*«
/opt/workspace/pgRouting/core/src/boost_wrapper.cpp:142: Warnung: veraltete Konvertierung von Zeichenkettenkonstante in »char*«
[ 83%] Building CXX object core/src/CMakeFiles/routing.dir/astar_boost_wrapper.o
/opt/workspace/pgRouting/core/src/astar_boost_wrapper.cpp: In function »int boost_astar(edge_astar_t*, unsigned int, int, int, bool, bool, path_element_t**, int*, char**)«:
/opt/workspace/pgRouting/core/src/astar_boost_wrapper.cpp:185: Warnung: veraltete Konvertierung von Zeichenkettenkonstante in »char*«
/opt/workspace/pgRouting/core/src/astar_boost_wrapper.cpp:192: Warnung: veraltete Konvertierung von Zeichenkettenkonstante in »char*«
/opt/workspace/pgRouting/core/src/astar_boost_wrapper.cpp:219: Warnung: veraltete Konvertierung von Zeichenkettenkonstante in »char*«
/opt/workspace/pgRouting/core/src/astar_boost_wrapper.cpp:228: Warnung: veraltete Konvertierung von Zeichenkettenkonstante in »char*«
[100%] Building CXX object core/src/CMakeFiles/routing.dir/shooting_star_boost_wrapper.o
/opt/workspace/pgRouting/core/src/shooting_star_boost_wrapper.cpp: In function »int boost_shooting_star(edge_shooting_star_t*, unsigned int, int, int, bool, bool, path_element_t**, int*, char**, int)«:
/opt/workspace/pgRouting/core/src/shooting_star_boost_wrapper.cpp:302: Warnung: veraltete Konvertierung von Zeichenkettenkonstante in »char*«
/opt/workspace/pgRouting/core/src/shooting_star_boost_wrapper.cpp:320: Warnung: veraltete Konvertierung von Zeichenkettenkonstante in »char*«
/opt/workspace/pgRouting/core/src/shooting_star_boost_wrapper.cpp:362: Warnung: veraltete Konvertierung von Zeichenkettenkonstante in »char*«
/opt/workspace/pgRouting/core/src/shooting_star_boost_wrapper.cpp:379: Warnung: veraltete Konvertierung von Zeichenkettenkonstante in »char*«
/opt/workspace/pgRouting/core/src/shooting_star_boost_wrapper.cpp:407: Warnung: veraltete Konvertierung von Zeichenkettenkonstante in »char*«
Linking CXX shared library ../../lib/librouting.so
[100%] Built target routing
daniel@bougainvilla:/opt/workspace/pgRouting$ 

Change History

  Changed 2 years ago by anton

  • status changed from new to assigned

Can you switch your system language and post the warning in English? Can you also check your compiler version?

follow-up: ↓ 9   Changed 2 years ago by daniel

Anton,

The compiler version is

daniel@bougainvilla:/opt/workspace/pgRouting$ gcc --version
gcc (GCC) 4.2.3 (Ubuntu 4.2.3-2ubuntu7)

Boost: 1.34.1
OS: Ubuntu 8.04

The English output:

daniel@bougainvilla:/opt/workspace/pgRouting$ make
[ 16%] Building C object core/src/CMakeFiles/routing.dir/dijkstra.o
[ 33%] Building C object core/src/CMakeFiles/routing.dir/astar.o
[ 50%] Building C object core/src/CMakeFiles/routing.dir/shooting_star.o
[ 66%] Building CXX object core/src/CMakeFiles/routing.dir/boost_wrapper.o
/opt/workspace/pgRouting/core/src/boost_wrapper.cpp: In function ‘int boost_dijkstra(edge_t*, unsigned int, int, int, bool, bool, path_element_t**, int*, char**)’:
/opt/workspace/pgRouting/core/src/boost_wrapper.cpp:108: warning: deprecated conversion from string constant to ‘char*’
/opt/workspace/pgRouting/core/src/boost_wrapper.cpp:115: warning: deprecated conversion from string constant to ‘char*’
/opt/workspace/pgRouting/core/src/boost_wrapper.cpp:134: warning: deprecated conversion from string constant to ‘char*’
/opt/workspace/pgRouting/core/src/boost_wrapper.cpp:142: warning: deprecated conversion from string constant to ‘char*’
[ 83%] Building CXX object core/src/CMakeFiles/routing.dir/astar_boost_wrapper.o
/opt/workspace/pgRouting/core/src/astar_boost_wrapper.cpp: In function ‘int boost_astar(edge_astar_t*, unsigned int, int, int, bool, bool, path_element_t**, int*, char**)’:
/opt/workspace/pgRouting/core/src/astar_boost_wrapper.cpp:185: warning: deprecated conversion from string constant to ‘char*’
/opt/workspace/pgRouting/core/src/astar_boost_wrapper.cpp:192: warning: deprecated conversion from string constant to ‘char*’
/opt/workspace/pgRouting/core/src/astar_boost_wrapper.cpp:219: warning: deprecated conversion from string constant to ‘char*’
/opt/workspace/pgRouting/core/src/astar_boost_wrapper.cpp:228: warning: deprecated conversion from string constant to ‘char*’
[100%] Building CXX object core/src/CMakeFiles/routing.dir/shooting_star_boost_wrapper.o
/opt/workspace/pgRouting/core/src/shooting_star_boost_wrapper.cpp: In function ‘int boost_shooting_star(edge_shooting_star_t*, unsigned int, int, int, bool, bool, path_element_t**, int*, char**, int)’:
/opt/workspace/pgRouting/core/src/shooting_star_boost_wrapper.cpp:302: warning: deprecated conversion from string constant to ‘char*’
/opt/workspace/pgRouting/core/src/shooting_star_boost_wrapper.cpp:320: warning: deprecated conversion from string constant to ‘char*’
/opt/workspace/pgRouting/core/src/shooting_star_boost_wrapper.cpp:362: warning: deprecated conversion from string constant to ‘char*’
/opt/workspace/pgRouting/core/src/shooting_star_boost_wrapper.cpp:379: warning: deprecated conversion from string constant to ‘char*’
/opt/workspace/pgRouting/core/src/shooting_star_boost_wrapper.cpp:407: warning: deprecated conversion from string constant to ‘char*’
Linking CXX shared library ../../lib/librouting.so
[100%] Built target routing
daniel@bougainvilla:/opt/workspace/pgRouting$ 

  Changed 2 years ago by anton

OK, I've found the reason - g++ 4.2 rejects a quoted string constant, where the function prototype has char*. Now I'm searching for a safe way to fix this. Probably, it is a good time to convert the error messages to error codes.

  Changed 2 years ago by daniel

If you change to error codes, let's file a new ticket and add a Wiki page.

  Changed 2 years ago by anton

Well, I found out that it is more easy to change char* to const char*. I'm going to do it and then I will ask you to check it with your g++ version.

  Changed 2 years ago by anton

Probably fixed with [178]. Can you please check it with your version of gcc?

  Changed 2 years ago by daniel

  • status changed from assigned to closed
  • resolution set to fixed

Not tested with routing query, but the warnings disappeared.

  Changed 2 years ago by sunrise

This works ok for me.. but It probably needs feedback. postlbs Air Jordan

in reply to: ↑ 2   Changed 7 months ago by mike3050

Replying to daniel:

Anton, The compiler version is {{{ daniel@bougainvilla:/opt/workspace/pgRouting$ gcc --version gcc (GCC) 4.2.3 (Ubuntu 4.2.3-2ubuntu7) }}} Boost: 1.34.1
OS: Ubuntu 8.04 The English output: {{{ daniel@bougainvilla:/opt/workspace/pgRouting$ make [ 16%] Building C object core/src/CMakeFiles/routing.dir/dijkstra.o [ 33%] Building C object core/src/CMakeFiles/routing.dir/astar.o [ 50%] Building C object core/src/CMakeFiles/routing.dir/shooting_star.o [ 66%] Building CXX object core/src/CMakeFiles/routing.dir/boost_wrapper.o /opt/workspace/pgRouting/core/src/boost_wrapper.cpp: In function ‘int boost_dijkstra(edge_t*, unsigned int, int, int, bool, bool, path_element_t**, int*, char**)’: /opt/workspace/pgRouting/core/src/boost_wrapper.cpp:108: warning: deprecated conversion from string constant to ‘char*’ /opt/workspace/pgRouting/core/src/boost_wrapper.cpp:115: warning: deprecated conversion from string constant to ‘char*’ /opt/workspace/pgRouting/core/src/boost_wrapper.cpp:134: warning: deprecated conversion from string constant to ‘char*’ /opt/workspace/pgRouting/core/src/boost_wrapper.cpp:142: warning: deprecated conversion from string constant to ‘char*’  auto insurance quote [ 83%] Building CXX object core/src/CMakeFiles/routing.dir/astar_boost_wrapper.o /opt/workspace/pgRouting/core/src/astar_boost_wrapper.cpp: In function ‘int boost_astar(edge_astar_t*, unsigned int, int, int, bool, bool, path_element_t**, int*, char**)’: /opt/workspace/pgRouting/core/src/astar_boost_wrapper.cpp:185: warning: deprecated conversion from string constant to ‘char*’ /opt/workspace/pgRouting/core/src/astar_boost_wrapper.cpp:192: warning: deprecated conversion from string constant to ‘char*’ /opt/workspace/pgRouting/core/src/astar_boost_wrapper.cpp:219: warning: deprecated conversion from string constant to ‘char*’ /opt/workspace/pgRouting/core/src/astar_boost_wrapper.cpp:228: warning: deprecated conversion from string constant to ‘char*’ [100%] Building CXX object core/src/CMakeFiles/routing.dir/shooting_star_boost_wrapper.o /opt/workspace/pgRouting/core/src/shooting_star_boost_wrapper.cpp: In function ‘int boost_shooting_star(edge_shooting_star_t*, unsigned int, int, int, bool, bool, path_element_t**, int*, char**, int)’: /opt/workspace/pgRouting/core/src/shooting_star_boost_wrapper.cpp:302: warning: deprecated conversion from string constant to ‘char*’ /opt/workspace/pgRouting/core/src/shooting_star_boost_wrapper.cpp:320: warning: deprecated conversion from string constant to ‘char*’ /opt/workspace/pgRouting/core/src/shooting_star_boost_wrapper.cpp:362: warning: deprecated conversion from string constant to ‘char*’ /opt/workspace/pgRouting/core/src/shooting_star_boost_wrapper.cpp:379: warning: deprecated conversion from string constant to ‘char*’ /opt/workspace/pgRouting/core/src/shooting_star_boost_wrapper.cpp:407: warning: deprecated conversion from string constant to ‘char*’ Linking CXX shared library ../../lib/librouting.so [100%] Built target routing daniel@bougainvilla:/opt/workspace/pgRouting$ }}}

Thank you .

  Changed 7 days ago by vedavyas

If you change to error codes, let's file a brand new ticket and add a Wiki page.  weight loss tips

Note: See TracTickets for help on using tickets.