This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: regarding gcc 4.1 to gcc 4.8


Hi jonathan;

Thanks for replay, i agree your point my question when i compile my code
with below system

*gcc version 4.1.2 20080704 (Red Hat 4.1.2-55) *
*ldd (GNU libc) 2.5*

its compiling without any error  and warning,

but same code if try compile with below system

*gcc version 4.8.5 20150623 (Red Hat 4.8.5-28) (GCC) *
*ldd (GNU libc) 2.17*

its giving error why is that, any backward comparability is there. i mean
any deprecated method is in new version, if yes what are deprecated method
and where i can see the list





On Sat, Jul 7, 2018 at 1:20 AM, Jonathan Wakely <jwakely.gcc@gmail.com>
wrote:

> On Fri, 6 Jul 2018 at 20:46, Vahith .j <vahith@gmail.com> wrote:
> >
> > Hi
> > Can you tell me any code change required when we are migrating from gcc
> > 4.1.x version to gcc 4.8.x and any reference link for migrating code to
> new
> > compiler
>
> I already told you: remove the bad declaration of getline.
>
> This is not a general "migrating from gcc 4.1.x version to gcc 4.8.x
> problem".
>
> It compiled previously, maybe by chance or maybe because you had a
> different glibc, which is not part of gcc, and so nothing to do with
> migrating to a newer gcc. For whatever reason, now it doesn't compile,
> because there are two different declarations for getline.
>
> getline is a standard function, defined by POSIX, so it will be
> defined by <stdio.h> and any code that includes <stdio.h> cannot
> declare a different function called getline.
>
> So as I already said, remove the bad declaration. Rename it, or remove
> it, or whatever you need to. But you have to fix it.
>
>
>
> >
> >
> >
> > On Friday, July 6, 2018, Vahith .j <vahith@gmail.com> wrote:
> >
> > > Hi All G'Day.,
> > >
> > > i am facing one issue when migrating my code to gcc 4.1 to 4.8, can you
> > > provide step to take for migration..
> > >
> > > *problems facing: *
> > > when i use gmake command on the my cpp code in gcc 4.1, it compiles
> fine
> > > and executing but same code when i using in gcc 4.8 version its giving
> > > below exception can you explain cause and solution for same
> > >
> > > error:
> > > *cc    -c -o include.o include.c*
> > > *In file included from include.c:30:0:*
> > > *def.h:131:9: error: conflicting types for ‘getline’*
> > > * char   getline();*
> > > *         ^*
> > > *In file included from def.h:31:0,*
> > > *                 from include.c:30:*
> > > */usr/include/stdio.h:678:20: note: previous declaration of ‘getline’
> was
> > > here*
> > > * extern IO_ssize_t getline (char restrict _lineptr,*
> > >
> > >
> > >
> > > Thanks in Advance
> > > vahith.j
> > >
> > >
> >
> > --
> > regards
> > vahith.j
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]