calejost / unimrcp

Automatically exported from code.google.com/p/unimrcp
Apache License 2.0
0 stars 0 forks source link

reserved identifier violation #62

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I suggest to try the search pattern "\<_(?:(?:_(.*))|([A-Z]+))" on source
files. A couple of places will be found where names begin with two
underscores or an underscore and an uppercase letter.

Examples:
* __MRCP_APPLICATION_H__

http://code.google.com/p/unimrcp/source/browse/trunk/libs/mrcp-client/include/mr
cp_application.h
  (Revision 1306)

* __RECORDER_SCENARIO_H__

http://code.google.com/p/unimrcp/source/browse/trunk/platforms/umc/include/recor
derscenario.h
  (Revision 1234)

This does not fit to the expected naming conventions of the C language
standard.
* See section "7.1.3 Reserved identifiers"
  http://www.open-std.org/JTC1/SC22/WG14/www/docs/n1124.pdf

* Book "The New C Standard: An Economic and Cultural Commentary" by Derek
M. Jones
  http://www.knosof.co.uk/cbook/

Original issue reported on code.google.com by Markus.E...@web.de on 31 Jan 2010 at 4:40

GoogleCodeExporter commented 8 years ago
Thanks for the note, Markus.

I can't say there are only a couple of places. The same naming convention is 
used for
all the header guards across the project. From other side, this is only a 
potential
violation, which caused no issues so far and I hardly assume it may cause any 
issues
in the future.
Nevertheless, yes, I'd prefer to use more consistent convention for the header 
guards
and will try to do that soon.

< __MRCP_APPLICATION_H__

> MRCP_APPLICATION_H

Original comment by achalo...@gmail.com on 1 Feb 2010 at 10:44

GoogleCodeExporter commented 8 years ago
Are you going to delete the leading underscores from all include guards in the 
near
future?

I suggest to append also an UUID as a suffix to make the names really unique

Original comment by Markus.E...@web.de on 1 Feb 2010 at 11:32

GoogleCodeExporter commented 8 years ago
Forgot to change the state of this issue.

Fixed in r1474.

See also post to the group
http://groups.google.com/group/unimrcp/browse_frm/thread/c9aa32f82c27fbd7

Original comment by achalo...@gmail.com on 10 Feb 2010 at 12:40

GoogleCodeExporter commented 8 years ago
I thank you very much for your adjustments.

You have mentioned in the topic "C/C++ header (#include) guards" that you 
didn't know
how to automate the generation of an UUID. I would like to add that I know it 
because
I developed a little program that calls the function "uuid_generate_random".   
;-)
http://linux.die.net/man/3/uuid_generate

If you ask more software developers, you might get also more help on automatic 
source
code generation for your tool box.

Original comment by Markus.E...@web.de on 10 Feb 2010 at 1:30