ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:103490] [Ruby master Bug#17809] Ruby 2.6.7 backported C99 code that breaks older compilers
@ 2021-04-16 21:46 tsmith84
  2021-04-19  1:00 ` [ruby-core:103509] " nobu
  2021-04-20 16:42 ` [ruby-core:103525] " merch-redmine
  0 siblings, 2 replies; 3+ messages in thread
From: tsmith84 @ 2021-04-16 21:46 UTC (permalink / raw)
  To: ruby-core

Issue #17809 has been reported by tas50 (Tim Smith).

----------------------------------------
Bug #17809: Ruby 2.6.7 backported C99 code that breaks older compilers
https://bugs.ruby-lang.org/issues/17809

* Author: tas50 (Tim Smith)
* Status: Open
* Priority: Normal
* ruby -v: 2.6.7
* Backport: 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN
----------------------------------------
Hey folks,

It looks like the 2.6.7 release inadvertently backported some C99 code from HEAD onto the Ruby 2.6 branch that shouldn't be requiring C99 compilers. This is causing us some pain and failures in our older versions of Chef that use Ruby 2.6 and are built without the C99 flag set on compilers.

Here's the patch we apply the 2.6.7 codebase to remove the C99 code:
https://github.com/chef/omnibus-software/blob/master/config/patches/ruby/ruby-2.6.7_c99.patch

Here's the commit that backported the C99 code:
https://github.com/ruby/ruby/commit/fe85a3d5271c4e3aeda42ec32e9c3f9ee02b6897

The particular line in the commit causing failures:
https://github.com/ruby/ruby/blob/fe85a3d5271c4e3aeda42ec32e9c3f9ee02b6897/hash.c#L5661

The failure we see while compiling:

```
gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23)
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
compiling hash.c
compiling load.c
compiling marshal.c
 
Error:
 
    hash.c: In function 'keylist_delete':
hash.c:5661: error: 'for' loop initial declarations are only allowed in C99 mode
hash.c:5661: note: use option -std=c99 or -std=gnu99 to compile your code
gmake: *** [Makefile:419: hash.o] Error 1
gmake: *** Waiting for unfinished jobs....`
```



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-04-20 16:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-16 21:46 [ruby-core:103490] [Ruby master Bug#17809] Ruby 2.6.7 backported C99 code that breaks older compilers tsmith84
2021-04-19  1:00 ` [ruby-core:103509] " nobu
2021-04-20 16:42 ` [ruby-core:103525] " merch-redmine

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).