Our website uses cookies to enhance your browsing experience.
Accept
to the top
>
>
>
V3144. This file is marked with a...
menu mobile close menu
Additional information
toggle menu Contents

V3144. This file is marked with a copyleft license, which may require you to disclose source code and modifications of the file.

May 14 2026

The analyzer has detected a copyleft license in a file, which may require disclosing source code when distributing or modifying the software. Depending on the type of license (strong or weak copyleft), these requirements may apply to the entire project or only to certain parts, which can be critical for commercial use.

If you develop an open-source project, ignore this warning and disable it.

The example of a comment that triggers the warning:

/*  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <https://www.gnu.org/licenses/>.
 */

Note N1. The diagnostic rule supports license detection using SPDX identifiers.

Note N2. If several SPDX identifiers are specified and at least one of them corresponds to a copyleft license, the analyzer issues a warning. This is because the analyzer cannot reliably determine which specific license applies to the derived project.

The example of an SPDX identifier that triggers the warning:

// spdx-license-identifier: MPL-2.0

For closed projects

If a file with a strong copyleft license, such as GPL, is added to a closed project, the rest of the source code must be disclosed due to the terms of such a license.

Strong copyleft licenses are often called "viral license", as they can spread to other files in the project. The problem is that using even a single file with such a license in a closed project makes the entire source code open and obligates you to distribute it along with the binary files.

If you add a file or library with a weak copyleft license—such as the LGPL—to a closed project, under certain conditions, you may be required to disclose the source code of the library and any modifications made to it, while the rest of the project may remain closed.

At the moment the diagnostic rule supports the following licenses:

Type

List of licenses

Strong copyleft

AGPL, EUPL, GPL, NGPL, NPOSL-3.0, OSL, RPL, SSPL

Weak copyleft

Artistic-2.0, CATOSL-1.1, CDDL, CPL, EPL, LGPL, MPL

The following options are available if you discover the use of copyleft-licensed files in a closed project:

  • abandon the use of this code (library) in your project;
  • replace the library being used;
  • make your project or its part open (in case of a weak copyleft license).

For open-source projects

This diagnostic rule is not applicable to open-source projects. The PVS-Studio team supports the development of open-source projects by helping fix errors in them and providing free licensing options. However, our product is a B2B solution, so this rule is enabled by default.

If your code is distributed under one of the copyleft licenses listed above, you can disable this rule in the following ways.

  • If you use PVS-Studio via an IDE plugin, you can disable the diagnostic rule directly in it. To do this, go to plugin settings > Detectable Errors > General Analysis and uncheck the V3144 item. Note that this setting only affects the display of the warning in the plugin. When opening a saved report on another machine or converting analysis results to another format, warnings disabled in this way may reappear.
  • If you want to disable the rule for the entire team or completely remove it from the analyzer reports, you can use the analyzer diagnostic rules configuration file (pvsconfig). To do this, add the //-V::3144 line to it. More information about disabling diagnostic rules using comments can be found in the documentation.
  • If you use the Plog Converter utility to convert reports, remove these warnings from the resulting report using the -d flag.

Additions to the list of copyleft licenses

If you know of other copyleft licenses that require source code disclosure and are not currently detected by the tool, please let us know via the feedback form. We will add support for them in future releases.

Links