Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify namespace compat w/ gcc 5 #873

Merged
merged 1 commit into from Oct 4, 2019
Merged

Specify namespace compat w/ gcc 5 #873

merged 1 commit into from Oct 4, 2019

Conversation

@mstemm
Copy link
Contributor

mstemm commented Oct 4, 2019

I wasn't able to compile the dev branch with gcc 5.4 (e.g. not using the
builder), getting this error:

.../falco/userspace/falco/grpc_server.cpp:40:109: error: specialization of ‘template<class Request, class Response> void falco::grpc::request_stream_context<Request, Response>::start(falco::grpc::server*)’ in different namespace [-fpermissive]
 void falco::grpc::request_stream_context<falco::output::request, falco::output::response>::start(server* srv)
                                                                                                             ^
In file included from .../falco/userspace/falco/grpc_server.cpp:26:0:
.../falco/userspace/falco/grpc_server.h:102:7: error:   from definition of ‘template<class Request, class Response> void falco::grpc::request_stream_context<Request, Response>::start(falco::grpc::server*)’ [-fpermissive]
  void start(server* srv);

It looks like gcc 5.4 doesn't handle a declaration with namespace blocks
but a definition with namespaces in the
function. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56480 has more
detail.

A workaround is to add namespace falco { and namespace grpc { around
the declarations.

Signed-off-by: Mark Stemm mark.stemm@gmail.com

What type of PR is this?

Uncomment one (or more) /kind <> lines:

/kind bug

/kind cleanup

/kind design

/kind documentation

/kind failing-test

/kind feature

/kind flaky-test

If contributing rules or changes to rules, please make sure to also uncomment one of the following line:

/kind rule-update

/kind rule-create

Any specific area of the project related to this PR?

Uncomment one (or more) /area <> lines:

/area build

/area engine

/area examples

/area rules

/area integrations

/area tests

What this PR does / why we need it:

Fix compilation on gcc 5.4 (and as early as 4.8, most likely)

Which issue(s) this PR fixes:

Fixes #862

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

Fix compilation on gcc 5.4 by working around gcc bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56480
I wasn't able to compile the dev branch with gcc 5.4 (e.g. not using the
builder), getting this error:

```
.../falco/userspace/falco/grpc_server.cpp:40:109: error: specialization of ‘template<class Request, class Response> void falco::grpc::request_stream_context<Request, Response>::start(falco::grpc::server*)’ in different namespace [-fpermissive]
 void falco::grpc::request_stream_context<falco::output::request, falco::output::response>::start(server* srv)
                                                                                                             ^
In file included from .../falco/userspace/falco/grpc_server.cpp:26:0:
.../falco/userspace/falco/grpc_server.h:102:7: error:   from definition of ‘template<class Request, class Response> void falco::grpc::request_stream_context<Request, Response>::start(falco::grpc::server*)’ [-fpermissive]
  void start(server* srv);
```

It looks like gcc 5.4 doesn't handle a declaration with namespace blocks
but a definition with namespaces in the
function. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56480 has more
detail.

A workaround is to add `namespace falco {` and `namespace grpc {` around
the declarations.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
@poiana poiana requested a review from Kaizhe Oct 4, 2019
@poiana poiana added the area/engine label Oct 4, 2019
@poiana poiana requested a review from mfdii Oct 4, 2019
@poiana poiana added the size/S label Oct 4, 2019
@leodido leodido self-requested a review Oct 4, 2019
@leodido
leodido approved these changes Oct 4, 2019
@poiana poiana added the lgtm label Oct 4, 2019
@poiana

This comment has been minimized.

Copy link

poiana commented Oct 4, 2019

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: leodido

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@poiana

This comment has been minimized.

Copy link

poiana commented Oct 4, 2019

LGTM label has been added.

Git tree hash: 9ff153cd47a3a54a9ba012857937c7f88b8956a4

@poiana poiana added the approved label Oct 4, 2019
@leodido leodido merged commit 2bc4bfd into dev Oct 4, 2019
3 of 4 checks passed
3 of 4 checks passed
tide Not mergeable. Job Travis CI - Pull Request has not succeeded.
Travis CI - Branch Build Passed
Details
Travis CI - Pull Request Build Passed
Details
dco All commits have Signed-off-by
Details
@poiana poiana deleted the fix-template-gcc-5-4 branch Oct 4, 2019
@Kaizhe

This comment has been minimized.

Copy link
Contributor

Kaizhe commented Oct 4, 2019

Great! Let me try!

@fntlnz fntlnz added this to the 0.18.0 milestone Oct 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.