Project

General

Profile

Actions

Feature #7108

open

build: error out on inappropriate use of dout()

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

Status:
New
Priority:
Normal
Assignee:
-
Category:
common
Target version:
-
% 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. ;)

Actions #1

Updated by Greg Farnum over 10 years ago

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

Updated by Sage Weil over 10 years ago

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

Actions

Also available in: Atom PDF