You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by hi...@apache.org on 2007/10/16 16:39:51 UTC

svn commit: r585156 - /harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/shared/hyport.c

Author: hindessm
Date: Tue Oct 16 07:39:44 2007
New Revision: 585156

URL: http://svn.apache.org/viewvc?rev=585156&view=rev
Log:
Fix compiler warning.

Modified:
    harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/shared/hyport.c

Modified: harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/shared/hyport.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/shared/hyport.c?rev=585156&r1=585155&r2=585156&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/shared/hyport.c (original)
+++ harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/shared/hyport.c Tue Oct 16 07:39:44 2007
@@ -590,7 +590,8 @@
 {
   char *endPathPtr = NULL;
   char *launcherName = NULL;
-  char **pathSet = portLib->mem_allocate_memory (portLib, sizeof(char*)*2);
+  const char **pathSet =
+          portLib->mem_allocate_memory (portLib, sizeof(char*)*2);
   char *vmPath = NULL;
 
   hysysinfo_get_executable_name (portLib, NULL, &launcherName);



Re: svn commit: r585156 - /harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/shared/hyport.c

Posted by Alexei Fedotov <al...@gmail.com>.
Mark,
Sorry, I've forgot to answer. (void*) worked for my platform. I've
added the patch you've suggested here:
http://issues.apache.org/jira/browse/HARMONY-4968

Thanks.




On 10/17/07, Mark Hindess <ma...@googlemail.com> wrote:
>
> Alexei,
>
> I've reverted the patch in r585384.  However, please can you try
> changing the problem line to:
>
>  portLib->mem_free_memory (portLib, (void*)pathSet);
>
> since I think that should also fix it - and still remove the
> warning (not treated as an error [yet]) on gcc 4.2.
>
> -Mark.
>
> On 17 October 2007 at 1:42, "Alexei Fedotov" <al...@gmail.com> wrote:
> > Hello Mark,
> >
> > It seems that this commit produce the following error in my
> > environment (Windows):
> >
> >      [java]      [exec] ..\shared\hyport.c(620) : error C2220: warning
> > treated as error - no object file generated
> >      [java]      [exec] ..\shared\hyport.c(620) : warning C4090:
> > 'function' : different 'const' qualifiers
> >
> > for the line:
> >     portLib->mem_free_memory (portLib, pathSet);
> >
> > I believe the easiest way to fix this is to revert the patch.
> > Thanks!
> >
> >
> >
> > On 10/16/07, hindessm@apache.org <hi...@apache.org> wrote:
> > > Author: hindessm
> > > Date: Tue Oct 16 07:39:44 2007
> > > New Revision: 585156
> > >
> > > URL: http://svn.apache.org/viewvc?rev=585156&view=rev
> > > Log:
> > > Fix compiler warning.
> > >
> > > Modified:
> > >     harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/sh
> > ared/hyport.c
> > >
> > > Modified: harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/p
> > ort/shared/hyport.c
> > > URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/p
> > ortlib/src/main/native/port/shared/hyport.c?rev=585156&r1=585155&r2=585156&vi
> > ew=diff
> > > ===========================================================================
> > ===
> > > --- harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/sh
> > ared/hyport.c (original)
> > > +++ harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/sh
> > ared/hyport.c Tue Oct 16 07:39:44 2007
> > > @@ -590,7 +590,8 @@
> > >  {
> > >    char *endPathPtr = NULL;
> > >    char *launcherName = NULL;
> > > -  char **pathSet = portLib->mem_allocate_memory (portLib, sizeof(char*)*2)
> > ;
> > > +  const char **pathSet =
> > > +          portLib->mem_allocate_memory (portLib, sizeof(char*)*2);
> > >    char *vmPath = NULL;
> > >
> > >    hysysinfo_get_executable_name (portLib, NULL, &launcherName);
> > >
> > >
> > >
> >
> >
> > --
> > With best regards,
> > Alexei,
> > ESSD, Intel
> >
>
>
>


-- 
With best regards,
Alexei,
ESSD, Intel

Re: svn commit: r585156 - /harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/shared/hyport.c

Posted by Mark Hindess <ma...@googlemail.com>.
Alexei,

I've reverted the patch in r585384.  However, please can you try 
changing the problem line to:

  portLib->mem_free_memory (portLib, (void*)pathSet);

since I think that should also fix it - and still remove the
warning (not treated as an error [yet]) on gcc 4.2.

-Mark.
  
On 17 October 2007 at 1:42, "Alexei Fedotov" <al...@gmail.com> wrote:
> Hello Mark,
> 
> It seems that this commit produce the following error in my
> environment (Windows):
> 
>      [java]      [exec] ..\shared\hyport.c(620) : error C2220: warning
> treated as error - no object file generated
>      [java]      [exec] ..\shared\hyport.c(620) : warning C4090:
> 'function' : different 'const' qualifiers
> 
> for the line:
>     portLib->mem_free_memory (portLib, pathSet);
> 
> I believe the easiest way to fix this is to revert the patch.
> Thanks!
> 
> 
> 
> On 10/16/07, hindessm@apache.org <hi...@apache.org> wrote:
> > Author: hindessm
> > Date: Tue Oct 16 07:39:44 2007
> > New Revision: 585156
> >
> > URL: http://svn.apache.org/viewvc?rev=585156&view=rev
> > Log:
> > Fix compiler warning.
> >
> > Modified:
> >     harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/sh
> ared/hyport.c
> >
> > Modified: harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/p
> ort/shared/hyport.c
> > URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/p
> ortlib/src/main/native/port/shared/hyport.c?rev=585156&r1=585155&r2=585156&vi
> ew=diff
> > ===========================================================================
> ===
> > --- harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/sh
> ared/hyport.c (original)
> > +++ harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/sh
> ared/hyport.c Tue Oct 16 07:39:44 2007
> > @@ -590,7 +590,8 @@
> >  {
> >    char *endPathPtr = NULL;
> >    char *launcherName = NULL;
> > -  char **pathSet = portLib->mem_allocate_memory (portLib, sizeof(char*)*2)
> ;
> > +  const char **pathSet =
> > +          portLib->mem_allocate_memory (portLib, sizeof(char*)*2);
> >    char *vmPath = NULL;
> >
> >    hysysinfo_get_executable_name (portLib, NULL, &launcherName);
> >
> >
> >
> 
> 
> -- 
> With best regards,
> Alexei,
> ESSD, Intel
> 



Re: svn commit: r585156 - /harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/shared/hyport.c

Posted by Alexei Fedotov <al...@gmail.com>.
Hello Mark,

It seems that this commit produce the following error in my
environment (Windows):

     [java]      [exec] ..\shared\hyport.c(620) : error C2220: warning
treated as error - no object file generated
     [java]      [exec] ..\shared\hyport.c(620) : warning C4090:
'function' : different 'const' qualifiers

for the line:
    portLib->mem_free_memory (portLib, pathSet);

I believe the easiest way to fix this is to revert the patch.
Thanks!



On 10/16/07, hindessm@apache.org <hi...@apache.org> wrote:
> Author: hindessm
> Date: Tue Oct 16 07:39:44 2007
> New Revision: 585156
>
> URL: http://svn.apache.org/viewvc?rev=585156&view=rev
> Log:
> Fix compiler warning.
>
> Modified:
>     harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/shared/hyport.c
>
> Modified: harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/shared/hyport.c
> URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/shared/hyport.c?rev=585156&r1=585155&r2=585156&view=diff
> ==============================================================================
> --- harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/shared/hyport.c (original)
> +++ harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/port/shared/hyport.c Tue Oct 16 07:39:44 2007
> @@ -590,7 +590,8 @@
>  {
>    char *endPathPtr = NULL;
>    char *launcherName = NULL;
> -  char **pathSet = portLib->mem_allocate_memory (portLib, sizeof(char*)*2);
> +  const char **pathSet =
> +          portLib->mem_allocate_memory (portLib, sizeof(char*)*2);
>    char *vmPath = NULL;
>
>    hysysinfo_get_executable_name (portLib, NULL, &launcherName);
>
>
>


-- 
With best regards,
Alexei,
ESSD, Intel