Skip to content

Remove const qualifier so it can be built with FCC #755

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

Merged
merged 2 commits into from
Jun 16, 2017

Conversation

ikitayama
Copy link

As of today the HEAD can not be built with FCC on the frontend for K computer. Please review and pull the patch into master.

@heplesser
Copy link
Contributor

@ikitayama Thank you for reporting this issue. The root of the problem is a inconsistency in the C++98 standard. Probably due to an oversight, basic_ofstream::is_open() is not a const method in the C++98 standard (§27.8.1.10), even though the underlying basic_filebuf::is_open() method is const (§27.8.1.3). In C++11 and later, is_open() is const also for basic_ofstream. It appears that the FCC compiler is the only one adhering strictly to the C++98 standard here.

Copy link
Contributor

@heplesser heplesser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ikitayama Thank you for your pull request. May I kindly ask you to add a comment explaining the background for this change (see my inline comment).

@@ -538,7 +538,7 @@ class RecordingDevice : public Device
//! Store current values in dictionary
void get( const RecordingDevice&, DictionaryDatum& ) const;
//! Set values from dictionary
void set( const RecordingDevice&, const Buffers_&, const DictionaryDatum& );
void set( const RecordingDevice&, Buffers_&, const DictionaryDatum& );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add the following comment here:

/* Note: `Buffers_&` cannot be `const` because `basic_ofstream::is_open()`
    is not `const` in C++98  (cf C++ Standard §27.8.1.10).
*/

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@heplesser please go ahead and add that on top my patch.

@heplesser heplesser added ZC: Kernel DO NOT USE THIS LABEL I: No breaking change Previously written code will work as before, no one should note anything changing (aside the fix) ZP: PR Created DO NOT USE THIS LABEL S: Critical Needs to be addressed immediately T: Bug Wrong statements in the code or documentation labels Jun 16, 2017
@heplesser heplesser merged commit 372f485 into nest:master Jun 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I: No breaking change Previously written code will work as before, no one should note anything changing (aside the fix) S: Critical Needs to be addressed immediately T: Bug Wrong statements in the code or documentation ZC: Kernel DO NOT USE THIS LABEL ZP: PR Created DO NOT USE THIS LABEL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants