Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6181737
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T01:04:43+00:00 2026-05-24T01:04:43+00:00

While trying to compile wxWidgets-2.9.1 from source with c++0x flags using gcc-4.6 . I

  • 0

While trying to compile wxWidgets-2.9.1 from source with c++0x flags using gcc-4.6. I came across an error

narrowing conversion of '128' from 'int' to 'char' inside { } [-fpermissive]
in the file src/gtk/dcclient.cpp. The error comes from the following files:

  1. src/gtk/bdiag.xbm
  2. src/gtk/cdiag.xbm
  3. src/gtk/fdiag.xbm
  4. src/gtk/horiz.xbm
  5. src/gtk/verti.xbm
  6. src/gtk/cross.xbm

This is a known bug.
http://trac.wxwidgets.org/ticket/12575
So I did as required and the program is compiling okay.

Basically, there are two kinds of fix that the diff file has

//in the file dcclient.h

  1. hatches[i] = gdk_bitmap_create_from_data(NULL, bdiag_bits, bdiag_width, bdiag_height);
    hatches[i] = gdk_bitmap_create_from_data(NULL, reinterpret_cast< const char* >(bdiag_bits), bdiag_width, bdiag_height);

    //in the file bdiag.xbm and similar fixes in all the *.xbm files

  2. static char bdiag_bits[] = {

    static unsigned char bdiag_bits[] = {
    0x80, 0x80, 0x40, 0x40, 0x20, 0x20, 0x10, 0x10, 0x08, 0x08, 0x04, 0x04,
    0x02, 0x02, 0x01, 0x01, 0x80, 0x80, 0x40, 0x40, 0x20, 0x20, 0x10, 0x10,
    0x08, 0x08, 0x04, 0x04, 0x02, 0x02, 0x01, 0x01};

I understand the second fix but I could not understand the first one. Why do we need to do a reinterpret_cast< const char* > The function gdk_bitmap_create_from_data is declared like this:

typedef char   gchar;//in some other header file

GdkBitmap* gdk_bitmap_create_from_data (GdkDrawable *drawable, const gchar *data, gint width, gint height);

while a few lines later in the same file dcclient.cpp the following call to the gdk_bitmap_create_from_data doesn’t give any error.

char* data = new char[data_size];
//...
GdkPixmap* pixmap = gdk_bitmap_create_from_data(mask, data, dst_w, dst_h);

Now here no typecast is required. Why do we need to do a reinterpret_cast on static unsigned char*?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T01:04:43+00:00Added an answer on May 24, 2026 at 1:04 am

    unsigned char, signed char and char (also known as ‘plain char’) are three different types. There is no conversion between unsigned char* and char*.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

While trying to compile a 64 bit linux kernel using gcc, I see the
While trying to generate classes from a xsd, i got this error: java.lang.IllegalArgumentException: Illegal
I'm trying to compile a python program using jython and it's throwing below error
I got an error today while trying to do some formatting to existing code.
While trying to compile the code below: template <class T> struct scalar_log_minimum { public:
While trying to compile my project, that uses some third party headers, with mingw
while trying to compile the following code in OpenCV2 in linux, cv::Mat image1, image2;
I am trying to compile go file using gccgo , i installed on my
I was trying to compile our project in Visual Studio 2010 using the 2005
I am trying to compile a sub-report from on the fly from java. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.