Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for QNX #988

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

chachoi
Copy link

@chachoi chachoi commented Jun 28, 2024

Modifications:

  • Change __QNXNTO__ to __QNX__ because __QNXNTO__ is deprecated
  • In xmltest.cpp, do not print nullptr because it would crash in QNX
  • Install tests for QNX

Build and test instuction for QNX:
https://github.com/chachoi-world/qnx-ports/blob/main/tinyxml2/README.md

Thanks.

@leethomason
Copy link
Owner

  • The "install" section for QNX is above the rest of the installs - and does QNX really need something unique there?
  • I don't think any system can print null strings. The changes to test looks like it may be hiding a bug

@chachoi
Copy link
Author

chachoi commented Jul 16, 2024

Hi, @leethomason

Thanks for responding to my pull request.

The "install" section for QNX is above the rest of the installs - and does QNX really need something unique there?

Yes, QNX is cross compiled from a Ubuntu machine, so xmltest and resources have to be installed to the QNX SDP (Software Development Platform) which is like an SDK for embedded targets so that users would be able to pick up the built xmltest and resources and put them on an embedded target to test.

I don't think any system can print null strings. The changes to test looks like it may be hiding a bug

I tested this sample program on my Ubuntu Linux machine, and I was able to print a null pointer:

#include <stdio.h>

int main() {
    const char* ptr = NULL;
	printf ("test %s\n", ptr);
}

The output is test (null).

When I run the same program in QNX I get:

Process 1302562 (a.out) terminated SIGSEGV code=1 fltno=11 ip=00000035fabe9c58 mapaddr=0000000000072c58 ref=0000000000000000
Memory fault (core dumped)

xmltest for Ubuntu successfully prints:

[pass] XMLDocument::Value() returns null? [(null)][(null)]

whereas QNX crashes becuase it cannot print null pointers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants