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

Questionable type detection in parseToPOD.cpp #95

Open
anjohnson opened this issue Jul 12, 2024 · 0 comments
Open

Questionable type detection in parseToPOD.cpp #95

anjohnson opened this issue Jul 12, 2024 · 0 comments

Comments

@anjohnson
Copy link
Member

This code in src/misc/parseToPOD.cpp breaks 64-bit RTEMS ARM builds (according to @kiwichris), and might be questionable on Windows and Apple too:

// need to use "long long" when sizeof(int)==sizeof(long)
#if (ULONG_MAX == 0xfffffffful) || defined(_WIN32) || defined(__rtems__) || defined(__APPLE__)
#define NEED_LONGLONG
#endif

Build errors:

../../src/misc/parseToPOD.cpp: In function 'void epics::pvData::detail::parseToPOD(const char*, int64_t*)':
../../src/misc/parseToPOD.cpp:137:38: error: invalid conversion from 'int64_t*' {aka 'long int*'} to 'long long int*' [-fpermissive]
  137 |     int err = epicsParseLongLong(in, out, 0, NULL);
      |                                      ^~~
      |                                      |
      |                                      int64_t* {aka long int*}
../../src/misc/parseToPOD.cpp:31:48: note:   initializing argument 2 of 'int epicsParseLongLong(const char*, long long int*, int, char**)'
   31 | epicsParseLongLong(const char *str, long long *to, int base, char **units)
      |                                     ~~~~~~~~~~~^~
../../src/misc/parseToPOD.cpp: In function 'void epics::pvData::detail::parseToPOD(const char*, uint64_t*)':
../../src/misc/parseToPOD.cpp:146:39: error: invalid conversion from 'uint64_t*' {aka 'long unsigned int*'} to 'long long unsigned int*' [-fpermissive]
  146 |     int err = epicsParseULongLong(in, out, 0, NULL);
      |                                       ^~~
      |                                       |
      |                                       uint64_t* {aka long unsigned int*}
../../src/misc/parseToPOD.cpp:62:58: note:   initializing argument 2 of 'int epicsParseULongLong(const char*, long long unsigned int*, int, char**)'
   62 | epicsParseULongLong(const char *str, unsigned long long *to, int base, char **units)
      |                                      ~~~~~~~~~~~~~~~~~~~~^~

I had no problems building the RTEMS-uC5282 on RTEMS-4.10.2 with the || defined(__rtems__) removed, but that's all I've checked.

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

No branches or pull requests

1 participant