× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



On 2022-08-13 11:22 a.m., Patrik Schindler wrote:
... One can include "key" as flag when referring to external defined files with #pragma mapinc. This results in a "_Packed struct" being defined for all key fields of the file in question. I was trying to typecast a char pointer to a variable of this type "_Packed struct …", but the compiler disallows this.
...

Can you show the code you're using to typecast the char pointer?

I'm not sure I'm doing the same thing you're trying to do, but I was able to do the following:

#pragma mapinc("test","BMORRIS/MAPINCF(REC)","key","")
#include "test"
main()
{
BMORRIS_MAPINCF_REC_key_t keys;
char *p;

p = (char *)&keys;
}

I didn't get a _Packed struct though. I just got an ordinary struct.

From the listing:
typedef struct {
char K1[10];
char K2[10];
} BMORRIS_MAPINCF_REC_key_t;


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.