yara icon indicating copy to clipboard operation
yara copied to clipboard

Common word 'parent' defined in header

Open VelocityRa opened this issue 3 years ago • 1 comments

This: https://github.com/VirusTotal/yara/blob/master/libyara/include/yara/modules.h#L214 makes Yara unusable in any project that has functions/methods/etc named parent which seems quite common.

It does break my own project since I have methods named that way. I have to patch Yara to use it.

VelocityRa avatar May 13 '21 14:05 VelocityRa

Same problem here, Yara headers break dependent projects.

Possible solutions to this:

  1. Rename the macro to something less common.
  2. Prefix macros with yara_.
  3. Make a hard separation between public and private headers. Include a common header with #undefs at the end of every public header.

~~Note that another macro, module, is a reserved keyword from C++20 onwards: https://github.com/VirusTotal/yara/blob/master/libyara/include/yara/modules.h#L213~~

EDIT: Already tracked at: https://github.com/VirusTotal/yara/issues/1493

AlexAltea avatar Aug 19 '21 14:08 AlexAltea