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

[ACE6] tao_idl Improvements #1366

Conversation

iguessthislldo
Copy link
Member

Backport of the appropriate features of #1357 to TAO 2.

  • Added an IDL preprocessor macro for the IDL version, __TAO_IDL_IDL_VERSION.
  • Added proper documentation for the __TAO_IDL IDL preprocessor macro.
  • Fixed issue encountered in this OpenDDS PR where OpenDDS' idl2jni, which is a tao_idl-derived compiler, can't properly handle relative includes because tao_idl makes a temporary copy that is passed to the preprocessor. Unlike in tao_idl Improvements #1357 guess is not the default for --preprocessor-input, but copy is, which is the current behavior.

Use conventional HTML, non breaking dashs, remove some outdated
information.
Make it easier to read and edit by replacing tabs with spaces.
This is a backport of the same commit in
DOCGroup#1357, but with copy
preprocessor input method being the default.

Fixes an issue that came up in
OpenDDS/OpenDDS#2161.

To make behavior of `#include ".."` consistent with C and C++, change
how `tao_idl` calls the C preprocessor by default in most cases from
making a copy of the IDL file to using the IDL file directly.
@@ -0,0 +1,7 @@
project(*): taoidldefaults {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
project(*): taoidldefaults {
project: taoidldefaults {

TAO/docs/compiler.html Show resolved Hide resolved
TAO/docs/compiler.html Show resolved Hide resolved
Comment on lines +10 to +12
`#include ".."` consistent with C and C++. This is not enabled by default
like it is in TAO 3, though. For details, see the `--preprocessor-input`
argument in `docs/compiler.html`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if the TAO 3 note is needed here. The scope of this section is TAO 2.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe, but it is a behavior difference between the two, so I feel like it has to be mentioned somewhere.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it require time travel to have TAO 2 know what TAO 3 does?

}
else
{
i++;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
i++;
++i;

{
ACE_ERROR ((LM_ERROR, ACE_TEXT ("Use \"guess\", \"direct-with-e\", ")
ACE_TEXT ("\"direct-without-e\", \"direct-gcc\", or \"copy\".\n"),
av[i]));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there supposed to be a %C or similar in the format string?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it's a old typo I copied from the code for --unknown-annotations. I will fix both.

if (!input) return 0;
const size_t size = ACE_OS::strlen (input);
char *output = 0;
ACE_NEW_RETURN (output, char [size], 0);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ACE_NEW_RETURN (output, char [size], 0);
ACE_NEW_RETURN (output, char[size], 0);

// Decide how files will be passed to the preprocessor
if (idl_global->preprocessor_input_ == IDL_GlobalData::PreprocessorInputGuess)
{
const char * const cpp_name = tolower (our_basename (FE_get_cpp_loc_from_env ()));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const char * const cpp_name = tolower (our_basename (FE_get_cpp_loc_from_env ()));
const char *const cpp_name = tolower (our_basename (FE_get_cpp_loc_from_env ()));

if (idl_global->preprocessor_input_ == IDL_GlobalData::PreprocessorInputGuess)
{
const char * const cpp_name = tolower (our_basename (FE_get_cpp_loc_from_env ()));
const char * method = "copy";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const char * method = "copy";
const char *method = "copy";

throw Bailout ();
}

if (WIFEXITED ((status)))
{
// Child terminated normally?
if (WEXITSTATUS ((status)) != 0)
const ACE_exitcode narrowed_status = WEXITSTATUS ((status));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const ACE_exitcode narrowed_status = WEXITSTATUS ((status));
ACE_exitcode const narrowed_status = WEXITSTATUS ((status));

@jwillemsen
Copy link
Member

See my comments of #1357, why not set the preprocessor handling through config*.h files instead of guessing it in tao_idl.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants