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

Comments

@vicuna
Copy link

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

This comment has been minimized.

Copy link
Author

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

This comment has been minimized.

Copy link
Author

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

This comment has been minimized.

Copy link
Author

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

This comment has been minimized.

Copy link
Author

commented Sep 28, 2018

Comment author: @nojb

#2075

@vicuna vicuna added the stdlib label Mar 14, 2019
@vicuna vicuna added the bug label Mar 20, 2019
@yallop

This comment has been minimized.

Copy link
Member

commented Apr 15, 2019

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

@nojb

This comment has been minimized.

Copy link
Contributor

commented Apr 15, 2019

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

Yes! Thanks for the reminder.

@nojb nojb closed this Apr 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.