Project

General

Profile

Actions

Bug #2234

closed

Only use -std=gnu99 flag when appropriate.

Added by brad@comstyle.com over 14 years ago. Updated over 14 years ago.

Status:
Wontfix
Priority:
Normal
Category:
build_autotools
Target version:
-
ASK QUESTIONS IN Forums:

Description

Currently the autoconf script tries to use the -std=gnu99 flag all of the time if using GCC but this breaks compilation with gcc 2.95. The attached patches fixes the autoconf script.


Files

patch-configure_ac.diff (626 Bytes) patch-configure_ac.diff brad@comstyle.com, 2010-07-06 15:37
Actions #1

Updated by Olaf-van-der-Spek over 14 years ago

Isn't the purpose of that flag to be able to use C99 features?
What's the reason to support such an old gcc version?

Actions #2

Updated by brad@comstyle.com over 14 years ago

Olaf-van-der-Spek wrote:

Isn't the purpose of that flag to be able to use C99 features?
What's the reason to support such an old gcc version?

Except there is no need for C99 code in lighttpd.

Its the system compiler and the lighttpd code compiles and works
fine. I don't see any good reason not to support it.

Actions #3

Updated by darix over 14 years ago

wrote:

Olaf-van-der-Spek wrote:

Isn't the purpose of that flag to be able to use C99 features?
What's the reason to support such an old gcc version?

Except there is no need for C99 code in lighttpd.

Its the system compiler and the lighttpd code compiles and works
fine. I don't see any good reason not to support it.

system compiler on what OS?
is the OS still supported by its vendor?
i mean 2.95 was like 10-11years ago.

Actions #4

Updated by brad@comstyle.com over 14 years ago

darix wrote:

wrote:

Olaf-van-der-Spek wrote:

Isn't the purpose of that flag to be able to use C99 features?
What's the reason to support such an old gcc version?

Except there is no need for C99 code in lighttpd.

Its the system compiler and the lighttpd code compiles and works
fine. I don't see any good reason not to support it.

system compiler on what OS?
is the OS still supported by its vendor?
i mean 2.95 was like 10-11years ago.

OpenBSD/sparc.

Yes. otherwise I wouldn't be submitting the diff.

Your point being? It builds the code just fine
and lighttpd runs just fine. What is the problem?

Actions #5

Updated by Olaf-van-der-Spek over 14 years ago

wrote:

Except there is no need for C99 code in lighttpd.

In that case, what's the point of setting -std=gnu99 at all?

Actions #6

Updated by brad@comstyle.com over 14 years ago

Olaf-van-der-Spek wrote:

wrote:

Except there is no need for C99 code in lighttpd.

In that case, what's the point of setting -std=gnu99 at all?

lighttpd builds just fine without it with the newer versions of gcc which support the -std=gnu99 flag (gcc3, gcc4) and it just hides the issue mentioned in my other ticket.

So I don't really see the point of that particular flag being added to CFLAGS when there is no C99 code within the lighttpd code base.

Actions #7

Updated by Olaf-van-der-Spek over 14 years ago

Then why doesn't your patch just remove the flag?

Actions #8

Updated by brad@comstyle.com over 14 years ago

Olaf-van-der-Spek wrote:

Then why doesn't your patch just remove the flag?

No particular reason. I could do that as well and would prefer to. The autoconf code was copied from another project which is in the same position of having no C99 code and compiling fine with gcc2.95, although it is setting the flag conditionally for newer gcc.

Actions #9

Updated by stbuehler over 14 years ago

I just tried compiling without -std=gnu99, and gcc threw a lot of warnings like:

src/mod_dirlisting.c:499: warning: string length ‘641’ is greater than the length ‘509’ ISO C90 compilers are required to support
/usr/include/mysql/mysql.h:128: warning: ISO C90 does not support ‘long long’
src/mod_status.c:213: warning: string length ‘767’ is greater than the length ‘509’ ISO C90 compilers are required to support
src/array.c:316: warning: ISO C90 does not support the ‘z’ gnu_printf length modifier

So:
  • we need the flag
  • there is no good reason to support such old compilers - if you are on such a platform you should be prepared to handle such things yourself.
    I really don't want to complicate the auto* stuff further.
Actions #10

Updated by stbuehler over 14 years ago

  • Status changed from New to Wontfix
  • Target version deleted (1.4.27)
Actions

Also available in: Atom