Bug 761021 - "-O2 -Wp,-D_FORTIFY_SOURCE=2 -pedantic -pedantic-errors" fails on FD_SET, FD_ISSET
Summary: "-O2 -Wp,-D_FORTIFY_SOURCE=2 -pedantic -pedantic-errors" fails on FD_SET, FD_...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: glibc
Version: 16
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jeff Law
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 730270
TreeView+ depends on / blocked
 
Reported: 2011-12-07 15:32 UTC by Petr Lautrbach
Modified: 2016-11-24 15:56 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-01-03 18:14:22 UTC
Type: ---


Attachments (Terms of Use)

Description Petr Lautrbach 2011-12-07 15:32:26 UTC
Description of problem:
I tried to build libssh package on Fedora 16 and build failed on following errors:
/builddir/build/BUILD/libssh-0.5.2/src/connect.c:480:37: error: ISO C forbids braced-groups within expressions [-pedantic]
/builddir/build/BUILD/libssh-0.5.2/src/connect.c:543:35: error: ISO C forbids braced-groups within expressions [-pedantic]
...

I am able to reproduce it with this:

$ cat test.c
#include <sys/select.h>

int main() {
  fd_set localset;

  FD_ZERO(&localset);
  FD_SET(0, &localset);
  return 0;
}

$ gcc -O2 -Wp,-D_FORTIFY_SOURCE=2 -pedantic -pedantic-errors  test.c
test.c: In function ‘main’:
test.c:7:3: error: ISO C forbids braced-groups within expressions [-pedantic]

$ rpm -q gcc glibc
gcc-4.6.2-1.fc16.x86_64
glibc-2.14.90-14.x86_64


libssh package was built successfully in Fedora 16 [1] with gcc-4.6.0-9.fc16 and glibc-2.13.90-9.

[1] http://koji.fedoraproject.org/koji/buildinfo?buildID=246140

Comment 1 Jeff Law 2011-12-14 16:26:26 UTC
I've already got a fix in the queue for this.

Comment 2 Jeff Law 2012-01-03 18:14:22 UTC
Fixed by 2.14.90-22 and later.


Note You need to log in before you can comment on or make changes to this bug.