* [Bug c++/35233] Unexpected error messages about invalid pointer conversions at end of array initialisation
2008-02-17 13:47 [Bug c++/35233] New: Unexpected error messages about invalid pointer conversions at end of array initialisation Markus dot Elfring at web dot de
@ 2008-02-17 13:56 ` Markus dot Elfring at web dot de
2008-02-17 14:03 ` Markus dot Elfring at web dot de
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Markus dot Elfring at web dot de @ 2008-02-17 13:56 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from Markus dot Elfring at web dot de 2008-02-17 13:55 -------
Created an attachment (id=15175)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15175&action=view)
preprocessed source file
I can circumvent the mentioned error messages if I partly deactivate the array
initialisation for some elements by the preprocessor instruction "#if 0".
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35233
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/35233] Unexpected error messages about invalid pointer conversions at end of array initialisation
2008-02-17 13:47 [Bug c++/35233] New: Unexpected error messages about invalid pointer conversions at end of array initialisation Markus dot Elfring at web dot de
2008-02-17 13:56 ` [Bug c++/35233] " Markus dot Elfring at web dot de
@ 2008-02-17 14:03 ` Markus dot Elfring at web dot de
2008-02-17 14:27 ` rguenth at gcc dot gnu dot org
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Markus dot Elfring at web dot de @ 2008-02-17 14:03 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from Markus dot Elfring at web dot de 2008-02-17 14:03 -------
Created an attachment (id=15176)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15176&action=view)
update candidates
I am surprised how the global variable "options_table" is affected by other
changes because it is untouched in comparison to the previous version.
https://sourceforge.net/tracker/?func=detail&atid=637567&aid=1680134&group_id=104305
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35233
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/35233] Unexpected error messages about invalid pointer conversions at end of array initialisation
2008-02-17 13:47 [Bug c++/35233] New: Unexpected error messages about invalid pointer conversions at end of array initialisation Markus dot Elfring at web dot de
2008-02-17 13:56 ` [Bug c++/35233] " Markus dot Elfring at web dot de
2008-02-17 14:03 ` Markus dot Elfring at web dot de
@ 2008-02-17 14:27 ` rguenth at gcc dot gnu dot org
2008-02-17 15:52 ` Markus dot Elfring at web dot de
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-02-17 14:27 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from rguenth at gcc dot gnu dot org 2008-02-17 14:26 -------
The problem is here:
sipp.cpp(137): error: a value of type "const char *const *" cannot be used to
initialize an entity of type "void *"
{"cid_str", "Call ID string (default %u-%p@%s). %u=call_number,
%s=ip_address, %p=process_number, %%=% (in any order).", 5, &call_id_string,
1},
^
sipp.cpp(247): error: a value of type "const char *const *" cannot be used to
initialize an entity of type "void *"
{"stat_delimiter", "Set the delimiter for the statistics file", 5,
&stat_delimiter, 1},
just add casts to (void *) after taking the addresses.
Also please use the gcc-help@ list for such questions, not bugzilla.
Thanks.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35233
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/35233] Unexpected error messages about invalid pointer conversions at end of array initialisation
2008-02-17 13:47 [Bug c++/35233] New: Unexpected error messages about invalid pointer conversions at end of array initialisation Markus dot Elfring at web dot de
` (2 preceding siblings ...)
2008-02-17 14:27 ` rguenth at gcc dot gnu dot org
@ 2008-02-17 15:52 ` Markus dot Elfring at web dot de
2008-02-17 15:56 ` rguenth at gcc dot gnu dot org
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Markus dot Elfring at web dot de @ 2008-02-17 15:52 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from Markus dot Elfring at web dot de 2008-02-17 15:52 -------
(In reply to comment #3)
> The problem is here:
> sipp.cpp(137): error: a value of type "const char *const *" cannot be used to
> initialize an entity of type "void *"
> {"cid_str", "Call ID string (default %u-%p@%s). %u=call_number,
> %s=ip_address, %p=process_number, %%=% (in any order).", 5, &call_id_string,
> 1},
>
> ^
Thanks for your suggestion.
> sipp.cpp(247): error: a value of type "const char *const *" cannot be used to
> initialize an entity of type "void *"
How did you get this error message? It is different from mine.
Each array element is initialised by five values that were not flagged with
errors before my source code refactoring. Well, I'm sorry - The initialisation
list was too long for me to remember that I updated the data type for two other
global variables that were referenced from the included source file "sipp.hpp".
The message did not point me to my error directly. I suggest to improve the
wording from "an entity" to "entity 'data'" in my use case.
struct sipp_option {
const char *option;
const char *help;
int type;
void *data;
int pass;
};
> just add casts to (void *) after taking the addresses.
The specification "void const* data;" would be another design option. It might
not be clear yet which way will be preferred for the concrete application.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35233
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/35233] Unexpected error messages about invalid pointer conversions at end of array initialisation
2008-02-17 13:47 [Bug c++/35233] New: Unexpected error messages about invalid pointer conversions at end of array initialisation Markus dot Elfring at web dot de
` (3 preceding siblings ...)
2008-02-17 15:52 ` Markus dot Elfring at web dot de
@ 2008-02-17 15:56 ` rguenth at gcc dot gnu dot org
2008-02-17 16:11 ` [Bug c++/35233] Feature request: precise error messages about invalid pointer conversions during " Markus dot Elfring at web dot de
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-02-17 15:56 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from rguenth at gcc dot gnu dot org 2008-02-17 15:55 -------
I used the Intel compiler to point me to the actual error.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35233
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/35233] Feature request: precise error messages about invalid pointer conversions during array initialisation
2008-02-17 13:47 [Bug c++/35233] New: Unexpected error messages about invalid pointer conversions at end of array initialisation Markus dot Elfring at web dot de
` (4 preceding siblings ...)
2008-02-17 15:56 ` rguenth at gcc dot gnu dot org
@ 2008-02-17 16:11 ` Markus dot Elfring at web dot de
2008-02-17 16:42 ` rguenth at gcc dot gnu dot org
2008-02-17 17:17 ` Markus dot Elfring at web dot de
7 siblings, 0 replies; 9+ messages in thread
From: Markus dot Elfring at web dot de @ 2008-02-17 16:11 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from Markus dot Elfring at web dot de 2008-02-17 16:11 -------
It was hard for me to spot the updated variables "stat_delimiter" and
"call_id_string" as the error reasons.
It would be nice if the GCC implementation will be even more precise than the
check with the Intel compiler. How do you think about better error indicators?
--
Markus dot Elfring at web dot de changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |UNCONFIRMED
Resolution|INVALID |
Summary|Unexpected error messages |Feature request: precise
|about invalid pointer |error messages about invalid
|conversions at end of array |pointer conversions during
|initialisation |array initialisation
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35233
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/35233] Feature request: precise error messages about invalid pointer conversions during array initialisation
2008-02-17 13:47 [Bug c++/35233] New: Unexpected error messages about invalid pointer conversions at end of array initialisation Markus dot Elfring at web dot de
` (5 preceding siblings ...)
2008-02-17 16:11 ` [Bug c++/35233] Feature request: precise error messages about invalid pointer conversions during " Markus dot Elfring at web dot de
@ 2008-02-17 16:42 ` rguenth at gcc dot gnu dot org
2008-02-17 17:17 ` Markus dot Elfring at web dot de
7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-02-17 16:42 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from rguenth at gcc dot gnu dot org 2008-02-17 16:41 -------
Well, certainly. We possibly already have an enhancement request for this.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |enhancement
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35233
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/35233] Feature request: precise error messages about invalid pointer conversions during array initialisation
2008-02-17 13:47 [Bug c++/35233] New: Unexpected error messages about invalid pointer conversions at end of array initialisation Markus dot Elfring at web dot de
` (6 preceding siblings ...)
2008-02-17 16:42 ` rguenth at gcc dot gnu dot org
@ 2008-02-17 17:17 ` Markus dot Elfring at web dot de
7 siblings, 0 replies; 9+ messages in thread
From: Markus dot Elfring at web dot de @ 2008-02-17 17:17 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from Markus dot Elfring at web dot de 2008-02-17 17:17 -------
I am curious on improvements for unambiguous error reporting with variable and
member names.
--
Markus dot Elfring at web dot de changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |diagnostic
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35233
^ permalink raw reply [flat|nested] 9+ messages in thread