[LU-12527] lustreapi.h not c++ compatible Created: 09/Jul/19  Updated: 15/Aug/19  Resolved: 15/Aug/19

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: Lustre 2.13.0

Type: Improvement Priority: Minor
Reporter: Robert Latham Assignee: Robert Latham
Resolution: Fixed Votes: 0
Labels: None
Environment:

C++


Attachments: File 0001-LU-12527-utils-Make-lustre_user.h-c-legal.patch     File lustre-getstripe.cc    
Rank (Obsolete): 9223372036854775807

 Description   

If one tries to compile a C++ program with the `lustre/lustreapi.h` header, the compiler will throw all kinds of warnings.

This issue came up on the mailing list a few years ago: http://lists.lustre.org/pipermail/lustre-discuss-lustre.org/2017-March/014268.html and I encountered it again in a different context this week. Guess not many C++ programs try to use lustreapi.h !



 Comments   
Comment by Robert Latham [ 09/Jul/19 ]

I attached a small C++ program to demonstrate the error. Both `clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final)` and `g++ (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0` give errors.

Comment by Robert Latham [ 10/Jul/19 ]

Here's a rough patch that makes g++ and clang++ happy.

Comment by Peter Jones [ 11/Jul/19 ]

Rob

Thank you for the bug report and patch. Are you able to submit your patch directly to Gerrit (see http://wiki.lustre.org/Using_Gerrit for details)? If not, then we can assign this ticket to another developer, but it will likely take longer to get attention

Peter

Comment by Robert Latham [ 11/Jul/19 ]

I'm going through the process. info@whamcloud probably gets a ton of spam, but it also got a request from me asking for permission to push to gerrit.

Comment by Peter Jones [ 11/Jul/19 ]

Try now Rob

Comment by Gerrit Updater [ 11/Jul/19 ]

Rob Latham (robl@mcs.anl.gov) uploaded a new patch: https://review.whamcloud.com/35471
Subject: LU-12527 utils: Make lustre_user.h c++-legal
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: e23c74817c7d1d2d2993e6a55bd4a899bfca342d

Comment by Robert Latham [ 11/Jul/19 ]

https://review.whamcloud.com/#/c/35471/

Comment by Gerrit Updater [ 15/Aug/19 ]

Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/35471/
Subject: LU-12527 utils: Make lustre_user.h c++-legal
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 14b11dc3526ad12a138ad750ab8824b3438dc00d

Comment by Peter Jones [ 15/Aug/19 ]

Landed for 2.13 - congrats Rob!

Generated at Sat Feb 10 02:53:22 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.