Opened 10 months ago

Closed 9 months ago

Last modified 9 months ago

#15638 closed defect (fixed)

error occurs on the hp ux 11.31

Reported by: liuqiong7618 Owned by:
Priority: normal Milestone: 3.0.1
Component: build Version: stable-latest
Keywords: Cc:
Blocked By: Blocking:
Patch: yes

Description

I download the wxWidgets 2.9.0.4 on the hp ux 11.31
create the directory base-release,unzip the file as following:
bzip2 -d wx*.tar.bz2
tar -xvf wx*.tar

cd ./wxWidgets-2.9.4/base-release
../configure --disable-gui --disable-shared --with-zlib=builtin --with-expat=builtin
gmake clean
gmake

but the error occurs(try the wxWidgets 3.0 also has the same issue ):
../src/common/wxcrt.cpp: In function invalid conversion from 1 of
../src/common/wxcrt.cpp:1317: error : invalid conversion from 1 of
../src/common/wxcrt.cpp:1317: error : initializing argument 1 of
nst char*, void*)r

Attachments (6)

wxW1.png download (36.6 KB) - added by liuqiong7618 10 months ago.
error
output.txt download (18.0 KB) - added by liuqiong7618 10 months ago.
configure output
configure.png download (8.0 KB) - added by liuqiong7618 10 months ago.
configure
wx-vsscanf-decl.diff download (4.3 KB) - added by vadz 10 months ago.
Patch working around the wrong vsscanf() declaration
patch.png download (12.2 KB) - added by liuqiong7618 10 months ago.
patch-new.png download (10.5 KB) - added by liuqiong7618 9 months ago.

Download all attachments as: .zip

Change History (29)

Changed 10 months ago by liuqiong7618

error

Changed 10 months ago by liuqiong7618

configure output

Changed 10 months ago by liuqiong7618

configure

comment:1 Changed 10 months ago by vadz

  • Status changed from new to infoneeded_new

Please retry with 3.0.0-rc2 and if the problem is still there, please try to find a way to get some real error messages -- I don't know what's going on here, but the error messages are definitely being truncated or otherwise corrupted. Please look at your terminal/compiler options.

Unfortunately we don't have access to HP-UX systems so we really can't do anything about it without (a lot of) your help. TIA!

comment:2 Changed 10 months ago by liuqiong7618

  • Status changed from infoneeded_new to new

Hi vadz:
Please refer to the attachment "wxW1.png" for the error messages in detail of running "gmake" command

Please refer to the attachment "output.txt" and "configure.png" for results of running "configure" command.

so, what can i do for more debug info.

comment:3 Changed 10 months ago by vadz

  • Status changed from new to infoneeded_new

I did see the attachments (BTW, there is really no need for the images, just copy and paste the text, inside triple curly braces, here, see WikiFormatting for more details). But the error message is clearly mangled, for unknown -- to me -- reasons.

Also, and most importantly, please do retry with 3.0.0-rc2 as I wrote.

comment:4 Changed 10 months ago by liuqiong7618

  • Status changed from infoneeded_new to new

I tried 3.0.0-rc2 also, the same errors occur

comment:5 Changed 10 months ago by vadz

  • Status changed from new to infoneeded_new

At least the line numbers should be different, what are the new errors?

Also, once again, we don't have access to HP-UX system for testing. Please try to see if your compiler has some other error reporting options and if your terminal is configured correctly (this could be done by redirecting the compiler output to a file) because I can't believe these are the complete error messages, this doesn't make any sense.

comment:6 Changed 10 months ago by liuqiong7618

  • Status changed from infoneeded_new to new

Hi vadz: I configure the terminal setting, now the error info isn't mangled.

../src/common/wxcrt.cpp: In function ‘int wxVsscanf(const char*, const char*, void*)’:
../src/common/wxcrt.cpp:1281: error: invalid conversion from ‘const char*’ to ‘char*’
../src/common/wxcrt.cpp:1281: error:   initializing argument 1 of ‘int vsscanf(char*, const char*, void*)’
../src/common/wxcrt.cpp: In function ‘int wxVsscanf(const wxCharBuffer&, const char*, void*)’:
../src/common/wxcrt.cpp:1285: error: invalid conversion from ‘const char*’ to ‘char*’
../src/common/wxcrt.cpp:1285: error:   initializing argument 1 of ‘int vsscanf(char*, const char*, void*)’
../src/common/wxcrt.cpp: In function ‘int wxVsscanf(const wxString&, const char*, void*)’:
../src/common/wxcrt.cpp:1289: error: invalid conversion from ‘const char*’ to ‘char*’
../src/common/wxcrt.cpp:1289: error:   initializing argument 1 of ‘int vsscanf(char*, const char*, void*)’
../src/common/wxcrt.cpp: In function ‘int wxVsscanf(const wxCStrData&, const char*, void*)’:
../src/common/wxcrt.cpp:1293: error: invalid conversion from ‘const char*’ to ‘char*’
../src/common/wxcrt.cpp:1293: error:   initializing argument 1 of ‘int vsscanf(char*, const char*, void*)’
* Error exit code 1

comment:7 Changed 10 months ago by vadz

  • Milestone changed from 3.0.0 to 3.0.1
  • Status changed from new to confirmed

OK, thanks, I think I see the problem now: your system headers incorrectly declare vsscanf() as taking char * instead of const char *.

Please try the attached patch and let me know if it fixes the problem for you (notice that you'll need to rerun configure), thanks.

Changed 10 months ago by vadz

Patch working around the wrong vsscanf() declaration

comment:8 follow-up: Changed 10 months ago by liuqiong7618

Hi :

Where can I download the patch? I cannot find the patch. I can see the different between the files.

So, should I modify the files by myself?

comment:9 in reply to: ↑ 8 Changed 10 months ago by oneeyeman

Replying to liuqiong7618:

Hi,

Hi :

Where can I download the patch? I cannot find the patch. I can see the different between the files.

So, should I modify the files by myself?

You need to download the file that Vadim attached to this ticket.
Just open the ticket, in the "Attachment" section find the file "wx-vsscanf-decl.diff", download it and either apply manually or using the "patch" command.

Then remove you build directory and start over.

Thank you.

comment:10 follow-up: Changed 10 months ago by liuqiong7618

I think it is troubled modify the files manually.

Sorry, But how to use the "patch" command.

Can you afford the steps in detailed?

eg: should I put the wx-vsscanf-decl.diff to the root directory of the wxWidgets?

which parameters should I use in the "patch" command?

comment:11 in reply to: ↑ 10 Changed 10 months ago by neis

Replying to liuqiong7618:

Sorry, But how to use the "patch" command.

(snipp)

which parameters should I use in the "patch" command?

Basically any of the topmost google result for applying patch is OK, personally I liked http://jungels.net/articles/diff-patch-ten-minutes.html best. In short, if you are in the wxWidgets root directory and have stored the patch there, patch -p1 < wx-vsscanf-decl.diff should work. For more general usage, notice the explanation about the -p parameter given in the above mentioned link. And of course, you can store the patch whereever you want (e.g. in /tmp) and apply it by giving its absolute or relative path instead of just the filename...

In general, having a paragraph on "HowToApplyAndTestPatches" in addition to "HowToSubmitPatches" in our wiki might be a good idea, even it just references external explanations (and even if it risks to not work for patches done from the "wrong" directory).

comment:12 follow-ups: Changed 10 months ago by liuqiong7618

I  put thewx-vsscanf-decl.diff to root directory of the wxWidgets.

execute the command "patch -p1 < wx-vsscanf-decl.diff"

but it prompt "I can't seem to find a patch in there".

please refer to the attachment "patch.png"

Changed 10 months ago by liuqiong7618

comment:13 Changed 10 months ago by liuqiong7618

I try the absolute path:

patch -p1 < /var/SPS/SPS/wxWidgets/wx-vsscanf-decl.diff

It also prompt "I can't seem to find a patch in there".

comment:14 in reply to: ↑ 12 Changed 9 months ago by neis

execute the command "patch -p1 < wx-vsscanf-decl.diff"

but it prompt "I can't seem to find a patch in there".

please refer to the attachment "patch.png"

Did you do @patch -p1 < wx-vsscanf-decl.diff@ like you wrote or @patch p1 < ...@ (note the missing "-" in front of p1) like your attachment seems to show (and which would make patch try to use the file @p1@ instead of trying to process an option)?

comment:15 Changed 9 months ago by liuqiong7618

Hi , I try " patch -p1 < wx-vsscanf-decl.diff ", the same error

can you post the modified files ? then I can replace the older files directly

the resouce code based on 3.0.0-rc2

Changed 9 months ago by liuqiong7618

comment:16 in reply to: ↑ 12 Changed 9 months ago by neis

Hi,

I put the wx-vsscanf-decl.diff to root directory of the wxWidgets.

Sorry for not having realized the flaw in oneeyeman's description earlier, even though I get caught in that trap on a regular basis myself. He wrote:

Just open the ticket, in the "Attachment" section find the file "wx-vsscanf-decl.diff", download it and ....

Well, that typically gives you the html-ified version of the patch which is modified/optimized for nicely displaying in the tracker, but doesn't work directly. Instead try this process for downloading:

  • Find the "wx-vsscanf-decl.diff"-link in this ticket.
  • Click on it. You get a nice page displaying a colorful version of the patch where lines on green background are the ones to be added and lines on red background are the ones to be removed.
  • Scroll to the bottom of this page.
  • There you should see the lines:

Download in other formats:

Original Format

  • Click on the link named "Original Format" and download the machine readable version of the patch, saving it e.g. as wx-vsscanf-decl.diff
  • Now, those calls to patch (patch -p1 < wx-vsscanf-decl.diff) really should work.

comment:17 Changed 9 months ago by liuqiong7618

I try to download the file according to your way, but it still say "I can't seem to find a patch in there"

  • Find the "wx-vsscanf-decl.diff"-link in this ticket.
  • Click on it. You get a nice page displaying a colorful version of the patch where lines on green background are the ones to be added and lines on red background are the ones to be removed.
  • Scroll to the bottom of this page.
  • There you should see the lines:

Download in other formats:

Original Format

comment:18 Changed 9 months ago by vadz

  • Patch set

Make sure you use GNU patch and not some HP program with the same name. If it still fails, please ask somebody working with you for instructions about applying the patches, it's impossible for us to know what are you doing wrong from here. If all else fails, apply the patch manually, it's not that difficult and the format of the patch file is pretty self-explanatory.

comment:19 Changed 9 months ago by liuqiong7618

Hi:

I want to known the *.diff was modified based on which wxWidgets version? is it wxWidgets-3.0.0-rc2?

my version is wxWidgets-3.0.0-rc2

comment:20 Changed 9 months ago by vadz

The patch was made against RC2 but this is not the problem here. If you get "can't find patch" error, it means that the patch file was somehow mangled/corrupted, otherwise you'd get a different error, indicating that it couldn't be applied.

comment:21 Changed 9 months ago by liuqiong7618

Thank you very much.

I reinstall patch ,now it works

Now ,the wxwidget build successfully on HP UX 11.31.

Thanks again

comment:22 Changed 9 months ago by VZ

  • Resolution set to fixed
  • Status changed from confirmed to closed

(In [75339]) Work around wrong vsscanf() declaration under HP-UX.

Under this system vsscanf() is declared as taking a non-const char* as first
argument which prevented our code using it from compiling. Wrap it in
wxCRT_VsscanfA() adding the necessary const_cast<> to fix this.

Closes #15638.

comment:23 Changed 9 months ago by VZ

(In [75340]) Work around wrong vsscanf() declaration under HP-UX.

Under this system vsscanf() is declared as taking a non-const char* as first
argument which prevented our code using it from compiling. Wrap it in
wxCRT_VsscanfA() adding the necessary const_cast<> to fix this.

Closes #15638.

Note: See TracTickets for help on using tickets.