Re: Optimization bug in VC++ 6.0
From: Alexander Grigoriev (alegr_at_earthlink.net)
Date: 03/24/04
- Next message: a.m.a: "Re: MsAgent SDK"
- Previous message: Matthias Kientz: "question marks in formatted strings"
- In reply to: Emmanuel Stapf: "Optimization bug in VC++ 6.0"
- Next in thread: tom_usenet: "Re: Optimization bug in VC++ 6.0"
- Reply: tom_usenet: "Re: Optimization bug in VC++ 6.0"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 23 Mar 2004 20:06:16 -0800
This code is not valid C.
Conversion of function pointer to void* is not allowed by C standard. See
ANSI C, paragraph 6.3.2.3.
Use exact function pointer type in your table. It will save you from errors.
Practice type-safe programming. The less casts, the better.
"Emmanuel Stapf" <manus_remove@remove_this_too.eiffel.com> wrote in message
news:epztw9JEEHA.4080@TK2MSFTNGP09.phx.gbl...
> Hi,
>
> The following code fails to compile and cl (VC++ 6.0 SP5) returns an
internal
> error.
>
> extern void f();
>
> void *tab[40];
> void tab_init () {
> long i;
> for (i = 8; i < 11; i++) {
> tab[i] = (void *) f;
> }
> }
>
> command line used: cl -Ox -c a.c
>
> compiler output:
> Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8804 for
80x86
> Copyright (C) Microsoft Corp 1984-1998. All rights reserved.
>
> a.c(7) : fatal error C1001: INTERNAL COMPILER ERROR
> (compiler file 'E:\8966\vc98\p2\src\P2\main.c', line 494)
> Please choose the Technical Support command on the Visual C++
> Help menu, or open the Technical Support help file for more
information
>
> Seems that it is fixed in later version of VC++, but I still need to use
VC 6.0.
>
> My question is how can I rewrite this code without disabling the
optimizations
> and without the internal compiler error.
>
> Thanks in advance,
> Manu
>
>
- Next message: a.m.a: "Re: MsAgent SDK"
- Previous message: Matthias Kientz: "question marks in formatted strings"
- In reply to: Emmanuel Stapf: "Optimization bug in VC++ 6.0"
- Next in thread: tom_usenet: "Re: Optimization bug in VC++ 6.0"
- Reply: tom_usenet: "Re: Optimization bug in VC++ 6.0"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|