GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Allow compiling on GCC 4.8 by The-EDev · Pull Request #399 · CrowCpp/Crow

Conversation

@The-EDev

@The-EDev The-EDev commented Apr 11, 2022

Copy link
Copy Markdown
Member

For some reason, is_callable does not work with GCC 4.8. This is most likely a bug with g++ itself.
CallHelper, which is_callable was meant to replace seems to work fine while compiling on g++ 4.8. I've run the tests and compiled the examples, everything seems to be fine.

@dranikpg I would very much appreciate your opinion on this since you wrote is_callable and have more experience with templates than myself.

This PR is a draft because I'm not 100% sure the changes I made are sound and won't introduce bugs down the line.

Fixes #386.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@The-EDev
Allowed compiling on GCC 4.8 by using CallHelper instead of is_callable
facae48
Also fixed issue with ssl test string comparison (which caused random incorrect failures)
@The-EDev
The-EDev requested review from luca-schlecker and mrozigor April 11, 2022 03:31
@crow-clang-format

crow-clang-format Bot commented Apr 11, 2022

Copy link
Copy Markdown
--- include/crow/middleware.h	(before formatting)
+++ include/crow/middleware.h	(after formatting)
@@ -248,7 +248,7 @@
           !black_magic::CallHelper<F, black_magic::S<Args...>>::value &&
             !black_magic::CallHelper<F, black_magic::S<crow::request&, Args...>>::value &&
             !black_magic::CallHelper<F, black_magic::S<crow::response&, Args...>>::value &&
-          black_magic::CallHelper<F, black_magic::S<const crow::request&, crow::response&, Args...>>::value,
+            black_magic::CallHelper<F, black_magic::S<const crow::request&, crow::response&, Args...>>::value,
           void>::type
           wrapped_handler_call(crow::request& req, crow::response& res, const F& f, Args&&... args)
         {
--- tests/ssl/ssltest.cpp	(before formatting)
+++ tests/ssl/ssltest.cpp	(after formatting)
@@ -73,7 +73,7 @@
         }
         else
         {
-            CHECK(std::string("Hello world, I'm keycrt.").substr((z*-1)) == to_test);
+            CHECK(std::string("Hello world, I'm keycrt.").substr((z * -1)) == to_test);
         }
     }
 
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dranikpg

dranikpg commented Apr 16, 2022

Copy link
Copy Markdown
Member

Gcc 4.8 is so old, I even had trouble installing it 😄

CallHelper and is_callable don't differ much except for CallHelper using additional "S<>" wrappers. My bad for introducting another version of almost the same.

This seems very much like a bug to me. I'd suggest to strip is_callable out and leave only the CallHelper. They don't differ in core functionality and everything should work.

However, you've replaced checks like std::enable_if<black_magic::is_callable<F, Args...>::value>::type with negation of all previous checks. We don't have templatized handlers, so this should make no difference. Any reasons for this change I might have not noticed?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@The-EDev

The-EDev commented Apr 16, 2022

Copy link
Copy Markdown
Member Author

Gcc 4.8 is so old, I even had trouble installing it

Fully agree, 9 yeas is a very long time in tech. Nevertheless IMO legacy support is still important, especially for C++.

CallHelper and is_callable don't differ much except for CallHelper using additional "S<>" wrappers. My bad for introducing another version of almost the same.

No worries, I believe the S<> wrappers worked around this specific bug.

This seems very much like a bug to me. I'd suggest to strip is_callable out and leave only the CallHelper. They don't differ in core functionality and everything should work.

Will do.

However, you've replaced checks like std::enable_if<black_magic::is_callable<F, Args...>::value>::type with negation of all previous checks. We don't have templatized handlers, so this should make no difference. Any reasons for this change I might have not noticed?

To be completely honest I wasn't sure of what I was doing, I looked at the diff in your original PR introducing is_callable and did things similar to how they were prior, I believe did run into a compilation issue when (at some point) I didn't correctly negate all the previous statements.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

The-EDev added 2 commits April 16, 2022 16:04
@The-EDev
Removed is_callable in favor of CallHelper + formatting
9f7ed83
@The-EDev
removed mentions of is_callable in middleware.h
0f3721f
@The-EDev
The-EDev marked this pull request as ready for review April 16, 2022 13:06
@The-EDev
Merge branch 'master' into gcc48
60b1d82
@The-EDev

The-EDev commented Apr 24, 2022

Copy link
Copy Markdown
Member Author

@mrozigor @luca-schlecker Could you guys make sure there's nothing that could be a problem later on with this? I have a history of adding things that end up generating too many bugs. Cough static files Cough.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mrozigor

mrozigor commented Apr 24, 2022

Copy link
Copy Markdown
Member

Generally I think that supporting very old soft isn't a good idea ;) Even developers don't support versions earlier than 9.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@luca-schlecker

luca-schlecker commented Apr 24, 2022

Copy link
Copy Markdown
Collaborator

I agree with @mrozigor here, GCC 4.8 is really old and I guess sticking to old tech is not only hindering progression in some cases, but can also cause a lot of trouble for little in return.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@The-EDev

The-EDev commented Apr 24, 2022

Copy link
Copy Markdown
Member Author

@mrozigor @luca-schlecker I understand your point fully, on the other hand We are working with C++11, a standard older than GCC 4.0.

Since the work has already been done, would it be appropriate to merge this PR and drop GCC 4 support if the need arises later on?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

mrozigor
mrozigor approved these changes Apr 25, 2022
View reviewed changes
@mrozigor

mrozigor commented Apr 25, 2022

Copy link
Copy Markdown
Member

Code looks good to me, but I haven't run it on 4.8.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@The-EDev
Merge branch 'master' into gcc48
b6a0405
@The-EDev

The-EDev commented Apr 25, 2022

Copy link
Copy Markdown
Member Author

I have, it worked fine for me

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@The-EDev
The-EDev merged commit 70faf20 into master Apr 26, 2022
@The-EDev
The-EDev deleted the gcc48 branch April 26, 2022 02:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@mrozigor mrozigor mrozigor approved these changes
@luca-schlecker luca-schlecker Awaiting requested review from luca-schlecker

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Compiling on GCC 4.8

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@The-EDev @dranikpg @mrozigor @luca-schlecker
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.