[llvm-commits] [vmkit] r51036 - /vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp

Bill Wendling isanbard at gmail.com
Tue May 13 11:02:58 PDT 2008


On Tue, May 13, 2008 at 7:14 AM, Nicolas Geoffray
<nicolas.geoffray at lip6.fr> wrote:
> Author: geoffray
> Date: Tue May 13 09:14:42 2008
> New Revision: 51036
>
> URL: http://llvm.org/viewvc/llvm-project?rev=51036&view=rev
> Log:
> Remove compilation warnings.
>
>
> Modified:
>    vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp
>
> Modified: vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp
> URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp?rev=51036&r1=51035&r2=51036&view=diff
>
> ==============================================================================
> --- vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp (original)
> +++ vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp Tue May 13 09:14:42 2008
> @@ -247,7 +247,7 @@
>   if (assemblyName == 0)
>     VMThread::get()->vm->error("can not find mscorlib.dll. Abort");
>
> -  vm->assemblyPath.push_back("");
> +  vm->assemblyPath.push_back((char*)"");
>   vm->assemblyPath.push_back(assemblyName);
>
>   const UTF8* mscorlib = vm->asciizConstructUTF8("mscorlib");
> @@ -424,7 +424,7 @@
>  }
>
>  extern "C" int start_app(int argc, char** argv) {
> -  N3* vm = N3::allocate("", N3::bootstrapVM);
> +  N3* vm = N3::allocate((char*)"", N3::bootstrapVM);

Wouldn't it be better to make N3::allocate and vm->assemblyPath take
"const char *" instead of doing this casting? If you really mean that
the argument should be "char *", it's not safe to pass in a string.
(Unless you compile with -fwritable-strings, in which case....ewwww!)

-bw



More information about the llvm-commits mailing list