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

Fixed compiler warnings #2350

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Conversation

mitza-oci
Copy link
Member

@mitza-oci mitza-oci commented Mar 10, 2025

Follow-on to #2339
Fixes #2347

Summary by CodeRabbit

  • Chores

    • Improved the build process by adding new build targets and updating the required version of Bison.
  • Refactor

    • Streamlined internal object construction by removing unnecessary copy mechanisms, enhancing resource management and overall code safety.
    • Updated command line formatting in testing to ensure consistent process handling.
    • Simplified class definitions by utilizing default member functions for constructors and destructors.

@mitza-oci mitza-oci requested a review from jwillemsen March 10, 2025 19:56
Copy link
Contributor

coderabbitai bot commented Mar 10, 2025

Walkthrough

The changes introduce GCC preprocessor directives in ACE service configuration files to suppress warnings about non-heap object deallocation and update the Bison parser’s source line tracking. Changes also modify the initialization in a copy constructor within a TAO valuebox visitor, alter the command line formatting in a concurrency test, and remove copy constructors and assignment operators in TAO’s servant and valuetype classes. Default pointer initialization is updated to use nullptr for clarity, ensuring a modernized codebase without altering core functionality.

Changes

File(s) Change Summary
ACE/ace/Svc_Conf.y
ACE/ace/Svc_Conf_y.cpp
Added GCC diagnostic push/pop directives to suppress -Wfree-nonheap-object warnings; updated the ace_yyrline array in the Bison parser implementation.
TAO/TAO_IDL/be/be_visitor_valuebox/valuebox_ci.cpp Removed the initialization of ::CORBA::DefaultValueRefCountBase in the copy constructor, retaining only ::CORBA::ValueBase initialization.
TAO/orbsvcs/tests/Concurrency/CC_command.cpp Modified the command line setup in CC_Start_Cmd::execute() by replacing the TCHAR conversion macro with a format specifier (ACE_TEXT("%C")).
TAO/tao/PortableServer/Servant_Base.cpp
TAO/tao/PortableServer/Servant_Base.h
Removed the copy constructor and assignment operator from TAO_ServantBase and updated the constructor’s default parameter from 0 to nullptr.
TAO/tao/Valuetype/ValueBase.cpp
TAO/tao/Valuetype/ValueBase.h
Removed the copy constructor and assignment operator for CORBA::DefaultValueRefCountBase (deleted in the header), enforcing non-copyable semantics.
ACE/ace/svcconfgen.mpc Added a new build target for Svc_Conf_y.cpp and Svc_Conf_Token_Table.h; updated the Bison version requirement in the error message to 3.8.2 or higher.
TAO/tao/Abstract_Servant_Base.cpp
TAO/tao/Abstract_Servant_Base.h
TAO/tao/Abstract_Servant_Base.inl
Removed the destructor implementation and changed the destructor, constructors, copy constructors, and assignment operators to defaulted versions in TAO_Abstract_ServantBase.
TAO/tao/tao.mpc Removed Abstract_Servant_Base.cpp from the build configuration for the TAO project.

Possibly related PRs

Poem

I'm a coding bunny, swift and spry,
Hopping through directives beneath the sky.
Pragma carrots lined up in neat array,
Copy constructors gone—simpler by day.
With nullptr and clean code, my heart is light,
A joyful hop in every byte!
🐇💻


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3f15614 and 6ad338b.

📒 Files selected for processing (12)
  • TAO/tao/PortableServer/Servant_Base.cpp (1 hunks)
  • TAO/tao/PortableServer/Servant_Base.h (1 hunks)
  • TAO/TAO_IDL/be/be_visitor_valuebox/valuebox_ci.cpp (1 hunks)
  • TAO/TAO_IDL/be/be_visitor_valuebox/valuebox_ci.cpp (2 hunks)
  • TAO/tao/PortableServer/Servant_Base.cpp (1 hunks)
  • TAO/tao/PortableServer/Servant_Base.h (1 hunks)
  • TAO/tao/Abstract_Servant_Base.cpp (0 hunks)
  • TAO/tao/Abstract_Servant_Base.h (2 hunks)
  • TAO/tao/Abstract_Servant_Base.inl (0 hunks)
  • TAO/tao/PortableServer/Servant_Base.cpp (2 hunks)
  • TAO/tao/PortableServer/Servant_Base.h (1 hunks)
  • TAO/tao/tao.mpc (0 hunks)
💤 Files with no reviewable changes (3)
  • TAO/tao/tao.mpc
  • TAO/tao/Abstract_Servant_Base.cpp
  • TAO/tao/Abstract_Servant_Base.inl
🚧 Files skipped from review as they are similar to previous changes (7)
  • TAO/TAO_IDL/be/be_visitor_valuebox/valuebox_ci.cpp
  • TAO/tao/PortableServer/Servant_Base.cpp
  • TAO/TAO_IDL/be/be_visitor_valuebox/valuebox_ci.cpp
  • TAO/tao/PortableServer/Servant_Base.cpp
  • TAO/tao/PortableServer/Servant_Base.h
  • TAO/tao/PortableServer/Servant_Base.h
  • TAO/tao/PortableServer/Servant_Base.h
⏰ Context from checks skipped due to timeout of 90000ms (15)
  • GitHub Check: ubuntu-24.04 g++-10 CodeQL
  • GitHub Check: ubuntu-24.04 g++-10 ACE for TAO
  • GitHub Check: ubuntu-24.04 g++-10 CORBA/e compact
  • GitHub Check: ubuntu-24.04 g++-10 CORBA/e micro
  • GitHub Check: ubuntu-24.04 clang++-16
  • GitHub Check: ubuntu-24.04 clang++-15
  • GitHub Check: ubuntu-24.04 clang++-14
  • GitHub Check: ubuntu-22.04 clang++-13
  • GitHub Check: ubuntu-22.04 clang++-12
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: ubuntu-22.04 g++-10
  • GitHub Check: macos-14-C++
  • GitHub Check: macos-13-C++
  • GitHub Check: ubuntu-24.04 g++
  • GitHub Check: alpine-3.18
🔇 Additional comments (7)
TAO/tao/PortableServer/Servant_Base.cpp (3)

58-58: Pointer notation style change

The parameter's pointer notation has been updated for consistency, reflecting a stylistic preference rather than a functional change.


64-68: Added copy constructor to fix compiler warnings

The new copy constructor properly initializes the reference count to 1 and copies the operation table from the source instance. This implementation addresses compiler warnings related to implicitly deleted copy operations.


70-78: Well-implemented assignment operator

The assignment operator includes proper self-assignment check using std::addressof and copies only the operation table. Good use of modern C++ practices with the std::addressof function for safer self-assignment detection.

TAO/tao/Abstract_Servant_Base.h (4)

72-72: Modernized destructor declaration

The virtual destructor is now explicitly defaulted, which is more modern and eliminates the need for an empty implementation in a separate cpp file.


139-139: Modernized default constructor

Explicitly defaulting the constructor improves code clarity and aligns with modern C++ practices.


142-142: Modernized copy constructor

Explicitly defaulting the copy constructor eliminates the need for an empty implementation and makes the code's intent clearer.


144-144: Modernized assignment operator

Explicitly defaulting the assignment operator follows modern C++ best practices and helps prevent potential bugs from implicit implementations.

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@mitza-oci
Copy link
Member Author

@jwillemsen here's the CodeQL problem I referenced earlier https://github.com/DOCGroup/ACE_TAO/pull/2350/checks?check_run_id=38572553836

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.

New warning in ACE
3 participants