[PATCH] Fix build failure with GCC 4.3

View: New views
10 Messages — Rating Filter:   Alert me  

[PATCH] Fix build failure with GCC 4.3

by Debarshi Ray :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Gengetopt 2.22 fails to build with the upcoming GCC 4.3 compiler (to
be released before and carried in Fedora 9). This tiny little patch
fixes it: http://rishi.fedorapeople.org/gengetopt-2.22-gcc43.patch

I also noticed that you use deprecated headers like stdio.h, stdlib.h,
etc. instead of cstdio, cstdlib, etc.. Any particular reason? Or would
you like a patch to fix them?

Happy hacking,
Debarshi
--
"From what we get, we can make a living; what we give, however, makes a life."
    -- Arthur Ashe


_______________________________________________
Help-gengetopt mailing list
Help-gengetopt@...
http://lists.gnu.org/mailman/listinfo/help-gengetopt

Re: [PATCH] Fix build failure with GCC 4.3

by Lorenzo Bettini :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Debarshi Ray wrote:
> Gengetopt 2.22 fails to build with the upcoming GCC 4.3 compiler (to
> be released before and carried in Fedora 9). This tiny little patch
> fixes it: http://rishi.fedorapeople.org/gengetopt-2.22-gcc43.patch
>
> I also noticed that you use deprecated headers like stdio.h, stdlib.h,
> etc. instead of cstdio, cstdlib, etc.. Any particular reason? Or would
> you like a patch to fix them?

thanks!

I still haven't switched to the new headers but probably I should by
now... I guess this will break backward compatibility, won't it?

cheers
        Lorenzo

--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
ICQ# lbetto, 16080134     (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
http://www.myspace.com/supertrouperabba
BLOGS: http://tronprog.blogspot.com  http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net


_______________________________________________
Help-gengetopt mailing list
Help-gengetopt@...
http://lists.gnu.org/mailman/listinfo/help-gengetopt

Re: [PATCH] Fix build failure with GCC 4.3

by Debarshi Ray :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> I guess this will break backward compatibility, won't it?

Even GCC 2.96 supports the modern C++ style headers:

debray@tista[205] cat hello.cpp
#include <iostream>

using namespace std;

int main (void)
{
  cout << "Hello world" << endl;
  return 0;
}
debray@tista[206] g++ --version
2.96
debray@tista[207] g++ hello.cpp
debray@tista[208] ./a.out
Hello world
debray@tista[209]

Considering we are going to have 4.3 sometime soon, I do not think we
should bother too much about losing backwards compatibility. :-)

Happy hacking,
Debarshi
--
"From what we get, we can make a living; what we give, however, makes a life."
    -- Arthur Ashe


_______________________________________________
Help-gengetopt mailing list
Help-gengetopt@...
http://lists.gnu.org/mailman/listinfo/help-gengetopt

Re: [PATCH] Fix build failure with GCC 4.3

by Lorenzo Bettini :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Debarshi Ray wrote:

>> I guess this will break backward compatibility, won't it?
>
> Even GCC 2.96 supports the modern C++ style headers:
>
> debray@tista[205] cat hello.cpp
> #include <iostream>
>
> using namespace std;
>
> int main (void)
> {
>   cout << "Hello world" << endl;
>   return 0;
> }
> debray@tista[206] g++ --version
> 2.96
> debray@tista[207] g++ hello.cpp
> debray@tista[208] ./a.out
> Hello world
> debray@tista[209]
>
> Considering we are going to have 4.3 sometime soon, I do not think we
> should bother too much about losing backwards compatibility. :-)

ooops... shame on me! :-)
I thought that only the C++ headers (like iostream) were backward
compatible and not the C headers!

then I'll surely have to switch to the new headers

thanks
        Lorenzo

--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
ICQ# lbetto, 16080134     (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
http://www.myspace.com/supertrouperabba
BLOGS: http://tronprog.blogspot.com  http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net



_______________________________________________
Help-gengetopt mailing list
Help-gengetopt@...
http://lists.gnu.org/mailman/listinfo/help-gengetopt

Re: [PATCH] Fix build failure with GCC 4.3

by Tim Post-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, 2008-03-06 at 17:28 +0530, Debarshi Ray wrote:
> > I guess this will break backward compatibility, won't it?

ACK :)

> Considering we are going to have 4.3 sometime soon, I do not think we
> should bother too much about losing backwards compatibility. :-)

ALOT of people still use older versions, you might not, but some do. It
really depends on how often someone argues with their compiler. I have
called g** an asshole 4 times today.

Since many packagers are brain dead and people elect grab the official
source tgz to get gengetopt (minus) whatever a packager does to it, I
would think backwards compat is paramount.

However, changing the headers (should not) break anything for most
people.. but I see no urgent reason to do it at this point in favor of
airing on the side of caution. Not saying its a bad idea.

Just my two cents.

Cheers,
--Tim




_______________________________________________
Help-gengetopt mailing list
Help-gengetopt@...
http://lists.gnu.org/mailman/listinfo/help-gengetopt

Re: [PATCH] Fix build failure with GCC 4.3

by Debarshi Ray :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

>  Since many packagers are brain dead and people elect grab the official
>  source tgz to get gengetopt (minus) whatever a packager does to it, I
>  would think backwards compat is paramount.

Many packagers are volunteers, just like many GNU developers are.
Flatly categorising them as "brain dead" is insulting.

Happy hacking,
Debarshi
--
"From what we get, we can make a living; what we give, however, makes a life."
    -- Arthur Ashe


_______________________________________________
Help-gengetopt mailing list
Help-gengetopt@...
http://lists.gnu.org/mailman/listinfo/help-gengetopt

Re: [PATCH] Fix build failure with GCC 4.3

by Tim Post-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, 2008-03-06 at 19:24 +0530, Debarshi Ray wrote:
> Many packagers are volunteers, just like many GNU developers are.
> Flatly categorising them as "brain dead" is insulting.

There was no offense meant by that remark. I call myself brain dead on
(at least) a weekly basis.

... I am one of those packagers :)

Cheers,
--Tim



_______________________________________________
Help-gengetopt mailing list
Help-gengetopt@...
http://lists.gnu.org/mailman/listinfo/help-gengetopt

Re: [PATCH] Fix build failure with GCC 4.3

by Lorenzo Bettini :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Tim Post wrote:
> On Thu, 2008-03-06 at 19:24 +0530, Debarshi Ray wrote:
>> Many packagers are volunteers, just like many GNU developers are.
>> Flatly categorising them as "brain dead" is insulting.
>
> There was no offense meant by that remark. I call myself brain dead on
> (at least) a weekly basis.
>
> ... I am one of those packagers :)

Wow, the first almost-flame on the list... ;-)
just kidding!

however, if gcc 2.95 supports cstdlib and co, probably we should switch
to such headers... also because, if I'm not wrong, if the compiler
cannot handle cstdlib headers it won't handle iostream (without the .h)
either, am I right?

cheers
        Lorenzo

--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
ICQ# lbetto, 16080134     (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
http://www.myspace.com/supertrouperabba
BLOGS: http://tronprog.blogspot.com  http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net


_______________________________________________
Help-gengetopt mailing list
Help-gengetopt@...
http://lists.gnu.org/mailman/listinfo/help-gengetopt

Re: [PATCH] Fix build failure with GCC 4.3

by Debarshi Ray :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

>  however, if gcc 2.95 supports cstdlib and co, probably we should switch
>  to such headers... also because, if I'm not wrong, if the compiler
>  cannot handle cstdlib headers it won't handle iostream (without the .h)
>  either, am I right?

I will try that on GCC 2.96 tomorrow and let you know.

Happy hacking,
Debarshi
--
"From what we get, we can make a living; what we give, however, makes a life."
    -- Arthur Ashe


_______________________________________________
Help-gengetopt mailing list
Help-gengetopt@...
http://lists.gnu.org/mailman/listinfo/help-gengetopt

Re: [PATCH] Fix build failure with GCC 4.3

by Debarshi Ray :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

>>  however, if gcc 2.95 supports cstdlib and co, probably we should switch
>>  to such headers... also because, if I'm not wrong, if the compiler
>>  cannot handle cstdlib headers it won't handle iostream (without the .h)
>>  either, am I right?

> I will try that on GCC 2.96 tomorrow and let you know.

It works:

debray@tista[41] cat hello.cpp
#include <cstdio>

using namespace std;

int main (void)
{
  printf("Hello world\n");
  return 0;
}
debray@tista[42] g++ --version
2.96
debray@tista[43] g++ hello.cpp
debray@tista[44] ./a.out
Hello world
debray@tista[45]

Happy hacking,
Debarshi
--
"From what we get, we can make a living; what we give, however, makes a life."
    -- Arthur Ashe


_______________________________________________
Help-gengetopt mailing list
Help-gengetopt@...
http://lists.gnu.org/mailman/listinfo/help-gengetopt