Skip to content
This repository has been archived by the owner on Jan 7, 2019. It is now read-only.

[driver] Block device: Add missing include #335

Merged

Conversation

rleh
Copy link
Member

@rleh rleh commented Jan 17, 2018

In driver/block_device_mirror.hpp std::max() is used, but #include <algorithm> was missing.

Additionally std::min() and std::max() in the mock-up stdc++ implementation are now constexpr and a example for AVR was added (but not tested in hardware).

Furthermore BlockDevice::DeviceSize was added.

@rleh
Copy link
Member Author

rleh commented Jan 17, 2018

How the heck do we still use avr-gcc-4.9.2 for Circle CI? It was released in October 30, 2014. Gee. 😉

@salkinium
Copy link
Member

salkinium commented Jan 21, 2018

How the heck do we still use avr-gcc-4.9.2 for Circle CI?

Because Ubuntu and most other distributions only ship the official toolchain which is stuck at gcc v5.4.0. That's okish, except it contains a compiler bug, which breaks modm CI, so now I'm building a completely new image using archlinux, which has avr-gcc v7.2.0.

@rleh
Copy link
Member Author

rleh commented Jan 23, 2018

GCC 5.4 should be fine for this PR.
But the Circle CI container is based on Ubuntu 14.04 which ships avr-gcc v4.9.2.

@salkinium
Copy link
Member

I've given up on Arch, it didn't have zmqpp headers. I've instead just compiled avr-gcc v7.2.0 + binutils for Ubuntu 17.10 here to use in our current Ubuntu based CircleCI images.

@daniel-k
Copy link
Member

I've given up on Arch, it didn't have zmqpp headers.

There's an AUR package for that: https://aur.archlinux.org/packages/zmqpp/

@salkinium
Copy link
Member

There's an AUR package for that

And… there are issues with linking against system libraries. I don't feel like debugging archlinux on a docker image running in CircleCI. I mean there is a limit to my masochist tendencies.

@daniel-k
Copy link
Member

And… there are issues with linking against system libraries.

Interesting, it's running smoothly on my system.

I don't feel like debugging archlinux on a docker image running in CircleCI. I mean there is a limit to my masochist tendencies.

However, this makes sense too 😄

@salkinium
Copy link
Member

CircleCI is now running avr-gcc 7, but:

algorithm_base.hpp:70:2: note: 'constexpr const T& std::max(const T&, const T&) [with T = long unsigned int]' is not usable as a constexpr function because:
  max(const T& a, const T& b)
  ^

Happy debugging ^^

@rleh
Copy link
Member Author

rleh commented Jan 28, 2018

algorithm_base.hpp:76:2: error: body of constexpr function 'constexpr const T& std::max(const T&, const T&) [with T = long unsigned int]' not a return-statement

Because: CircleCI still uses avr-g++ (GCC) 4.9.2 (see ci/circleci: hosted-unittests -> Check environment)

@salkinium Could you please initiate a new CircleCI build? I rebased this branch on develop, so the updated CircleCI config file from #337 is included.

@rleh rleh force-pushed the fix/block_device-stdcpp_algorithm branch from 6a2d848 to e068490 Compare January 28, 2018 00:15
@salkinium salkinium merged commit e068490 into roboterclubaachen:develop Jan 28, 2018
@rleh rleh deleted the fix/block_device-stdcpp_algorithm branch February 1, 2018 15:49
@salkinium salkinium added this to the 2018q1 milestone Apr 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants