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

Restrict qualifier applied wrongly. #97

Open
dermont123 opened this issue Apr 22, 2018 · 2 comments
Open

Restrict qualifier applied wrongly. #97

dermont123 opened this issue Apr 22, 2018 · 2 comments

Comments

@dermont123
Copy link

dermont123 commented Apr 22, 2018

Hi,
The "__restrict__" qualifier is for linux only and applied to the start of the decl_string, rather than the end.
`
#if defined( _MSC_VER )
#define RESTRICT_ALIAS __restrict
#define RESTRICT_ALIAS_RETURN __restrict
#else
#define RESTRICT_ALIAS __restrict__
#define RESTRICT_ALIAS_RETURN
#endif

class Rest {
protected:
float* RESTRICT_ALIAS restVar; ----- (1)
...
};
`
(1) The return_type.decl_string output produces the following ie.
::ns::Rest::restVar __restrict__ float *

From class restrict_t
def build_decl_string(self, with_defaults=True): return '__restrict__ ' + self.base.build_decl_string(with_defaults)
Code using the decl_string does not compile, the restrict qualifier should be applied to the pointer/ref/function not the variable, e.g.
def build_decl_string(self, with_defaults=True): if os.name == 'nt': return self.base.build_decl_string(with_defaults) + ' __restrict' else: return self.base.build_decl_string(with_defaults) + ' __restrict__'

@dermont123
Copy link
Author

Any news on this?

@tao558
Copy link
Contributor

tao558 commented Mar 11, 2021

Any news on this?

Starting work on this now. Can I use your above example in a test case?

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