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

caml/misc.h leaks reserved identifier #7729

Closed
vicuna opened this issue Feb 17, 2018 · 6 comments
Closed

caml/misc.h leaks reserved identifier #7729

vicuna opened this issue Feb 17, 2018 · 6 comments
Assignees

Comments

@vicuna
Copy link

vicuna commented Feb 17, 2018

Original bug ID: 7729
Reporter: ab
Assigned to: @nojb
Status: assigned (set by @nojb on 2018-09-28T10:43:30Z)
Resolution: open
Priority: normal
Severity: minor
Platform: all
OS: all
OS Version: all
Version: 4.06.1
Category: runtime system and C interface
Monitored by: @nojb

Bug description

clang -Wreserved-id-macro -x c /dev/null -S -include $(ocamlc -where)/caml/misc.h
In file included from :1:
/net/lib/ocaml/caml/misc.h:208:9: warning: macro name is a reserved identifier
[-Wreserved-id-macro]
#define _T(x) x
^
1 warning generated.

===
7.1.3 of ISO/IEC 9899:201x in part reads:

All identifiers that begin with an underscore and either an uppercase letter or another
underscore are always reserved for any use.

Steps to reproduce

clang -Wreserved-id-macro -x c /dev/null -S -include $(ocamlc -where)/caml/misc.h

@vicuna
Copy link
Author

vicuna commented Feb 17, 2018

Comment author: @dra27

The macro definition exists for compatibility with Windows NT's macro definition for Unicode string constants. Is this causing an actual problem, or "just" a standards warning?

@vicuna
Copy link
Author

vicuna commented Feb 18, 2018

Comment author: ab

It's enabled when using -Weverything (clang 5.0.1 at least). -Weverything enables few other diagnostics and caught real problems (unintended use of VLAs for instance) when used to build some of my code.

@vicuna
Copy link
Author

vicuna commented Feb 18, 2018

Comment author: @nojb

I think we should fix this. One is also liable to get a redefined macro warning if including <tchar.h> under Windows.

@vicuna
Copy link
Author

vicuna commented Sep 28, 2018

Comment author: @nojb

#2075

@yallop
Copy link
Member

yallop commented Apr 15, 2019

@nojb: can this be closed now that #2075 is merged?

@nojb
Copy link
Contributor

nojb commented Apr 15, 2019

@nojb: can this be closed now that #2075 is merged?

Yes! Thanks for the reminder.

@nojb nojb closed this as completed Apr 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants