cannot convert 'bool' to 'boolean' in return

Bug #1778626 reported by Luiz Angelo Daros de Luca
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
HPLIP
Fix Released
Undecided
Unassigned

Bug Description

I'm compiling hplip-3.18.6 for OpenWrt 18.06-RC1. However, it failed with this error:

prnt/hpcups/genPCLm.cpp: In function 'boolean writeOutputFile(int, ubyte*, char*)':
prnt/hpcups/genPCLm.cpp:353:10: error: cannot convert 'bool' to 'boolean' in return
   return true;
          ^~~~
prnt/hpcups/genPCLm.cpp:367:13: error: cannot convert 'bool' to 'boolean' in return
  return(true);
             ^
prnt/hpcups/genPCLm.cpp: In function 'boolean prepImageForBacksideDuplex(ubyte*, sint32, sint32, sint32)':
prnt/hpcups/genPCLm.cpp:1113:13: error: cannot convert 'bool' to 'boolean' in return
  return(true);
             ^
Makefile:7777: recipe for target 'hpcups-genPCLm.o' failed

I'm no C expert but boolean used here is not consumed by any caller. I simply replaced them with bool and it worked.

Is it a problem with OpenWrt SDK or hplip?

Revision history for this message
srinivas (srinivas5) wrote :

Hi Luiz,

It is not a hplip issue. Kindly let us know if you face any further issues.

Thanks,
Srinivas Teja.

Revision history for this message
Luiz Angelo Daros de Luca (luizluca) wrote :

I'm sorry but I didn't understand why it is not hplip issue.
It might be a compiler/env difference that trigger the problem. I'm using musl instead of glibc. Probably TRUE/FALSE wasn't defined in my env.

However, I'm no C expert but it looks like true is not boolean but bool while TRUE is used for boolean types.

prnt/hpcups/genPCLm.cpp:prepImageForBacksideDuplex and prnt/hpcups/genPCLm.cpp:writeOutputFile both uses boolean as return type but they use "return true;".

I get rid of the error by either changing the return type from boolean to bool or changing uses of "return true;" to "return TRUE;" inside these two functions. Anyway is good as no one consumes that result.

Ayushi (ayushi18)
Changed in hplip:
status: New → In Progress
Revision history for this message
srinivas (srinivas5) wrote :

Hi Luiz,

We have defined boolean as int in HPLIP code, hence it does not throw any error.

Thanks,
Srinivas Teja.

Changed in hplip:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.