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

error: must use 'struct' tag to refer to type ... #255

Open
Robert-M-Muench opened this issue Jul 10, 2020 · 3 comments
Open

error: must use 'struct' tag to refer to type ... #255

Robert-M-Muench opened this issue Jul 10, 2020 · 3 comments

Comments

@Robert-M-Muench
Copy link

I have this code on windows and run dstep on Windows 64-bit too:

#pragma once

#include <cstring>
#include <cassert>

struct som_passport_t;

typedef UINT64 som_atom_t;


struct som_asset_t;

struct som_asset_class_t {
  long(*asset_add_ref)(som_asset_t* thing);
  long(*asset_release)(som_asset_t* thing);
  long(*asset_get_interface)(som_asset_t* thing, const char* name, void** out);
  som_passport_t* (*asset_get_passport)(som_asset_t* thing);
};

For this code snippet I get a bunch of errors:

./include/sciter-om.h:4:10: warning: the current #pragma pack alignment value is modified in the included file [-Wpragma-pack]
./include/sciter-om.h:14:24: error: must use 'struct' tag to refer to type 'som_asset_t'
./include/sciter-om.h:15:24: error: must use 'struct' tag to refer to type 'som_asset_t'
./include/sciter-om.h:16:30: error: must use 'struct' tag to refer to type 'som_asset_t'
./include/sciter-om.h:17:3: error: must use 'struct' tag to refer to type 'som_passport_t'
./include/sciter-om.h:17:41: error: must use 'struct' tag to refer to type 'som_asset_t'

I really don't understand the problem, because this is pretty straight forward C code. Any idea how to solve this?

@jacob-carlborg
Copy link
Owner

Based on the error messages I would say this is a C++ header file. In C, when referring to the name of a struct, the keyword struct need to be included. Currently DStep doesn't support C++. This particular header might still work if you set the language to C++, same flags as for Clang.

@Robert-M-Muench
Copy link
Author

Ok, thanks. Trying.

BTW: Is there a way that Dstep will write the result as far as it made it? And not stop on an error? With this I could take the result and manually fix/extend all missing parts.

@jacob-carlborg
Copy link
Owner

Unfortunately no. If there are compile errors those will occur before DStep get an chance to process.

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

2 participants