Merge lp:~dcow90/myro-c++/extern-c into lp:myro-c++

Proposed by David Cowden on 2011-07-01
Status: Merged
Approved by: John Hoare on 2011-08-22
Approved revision: 84
Merged at revision: 100
Proposed branch: lp:~dcow90/myro-c++/extern-c
Merge into: lp:myro-c++
Diff against target: 12 lines (+1/-1)
1 file modified
headers/Scribbler.h (+1/-1)
To merge this branch: bzr merge lp:~dcow90/myro-c++/extern-c
Reviewer Review Type Date Requested Status
John Hoare 2011-07-01 Approve on 2011-08-22
Review via email: mp+66661@code.launchpad.net

Description of the change

The change is described in detail in the commit. I changed one function prototype so it is compatible with the use of extern "C" (I believe that was the issue). My guess is, when using extern "C", functions overloaded with a void version and a null string version:

function();

and

function (string s = "");

break down both into the same signature to the compiler. Which is why the compiler was complaining.

Simply changing the prototype to:

function (string s);

fixes the error and allows us to compile against the Scribbler header.

Please feel free to ask any questions. This was a confusing error to come across and one that didn't manifest until recently and under special conditions so I may need to explain it better.

To post a comment you must log in.
John Hoare (jhoare) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'headers/Scribbler.h'
2--- headers/Scribbler.h 2011-06-28 01:17:27 +0000
3+++ headers/Scribbler.h 2011-07-01 21:08:32 +0000
4@@ -433,7 +433,7 @@
5 * @return An integer represent the light intensity for the specified
6 * window.
7 */
8- int getBright(std::string value = "");
9+ int getBright(std::string value);
10
11 /**
12 * Used to query a specified light sensor located on the rear of the

Subscribers

People subscribed via source and target branches