Project

General

Profile

Feature #7108

build: error out on inappropriate use of dout()

Added by Greg Farnum over 5 years ago. Updated over 5 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
common
Target version:
-
Start date:
01/06/2014
Due date:
% Done:

0%

Source:
Development
Tags:
Backport:
Reviewed:
Affected Versions:
Pull request ID:

Description

Right now, if you use dout() instead of ldout() in a library context, the compilation phase goes fine and then you get a lovely linker error about not being able to find "g_ceph_context" that doesn't point at the real issue at all.
This is because dout() is implicitly referencing g_ceph_context, but we don't supply globals for our libraries. I think all we need to do to make this work out better is to #undef dout in all the library context headers. Then you'll get a compile error you can do something with instead of a linker error you need to just know about ahead of time. ;)

History

#1 Updated by Greg Farnum over 5 years ago

  • Subject changed from build: error out on inappropriate use of rout() to build: error out on inappropriate use of dout()

#2 Updated by Sage Weil over 5 years ago

alternatively, do not define dout or g_ceph_context at all for library code.

Also available in: Atom PDF