The OpenNET Project / Index page

[ новости /+++ | форум | теги | ]



"PVS-Studio доступен для бесплатного использования открытыми ..."
Версия для распечатки Пред. тема | След. тема
Форум Разговоры, обсуждение новостей
Исходное сообщение [ Отслеживать ]
Присылайте удачные настройки в раздел примеров файлов конфигурации на WIKI.opennet.ru.
. "PVS-Studio доступен для бесплатного использования открытыми ..." +1 +/
Сообщение от pavlinux (ok), 04-Дек-16, 18:46 
> Для автоматизации добавления комментариев можно воспользоваться специальной утилитой

$ git clone https://github.com/viva64/how-to-use-pvs-studio-free.git
$ cd how-to-use-pvs-studio-free/
$ cmake .
-- The C compiler identification is GNU 4.9.2
-- The CXX compiler identification is GNU 4.9.2
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/how-to-use-pvs-studio-free

# make
Scanning dependencies of target how-to-use-pvs-studio-free
[ 33%] [ 66%] [100%] Building CXX object CMakeFiles/how-to-use-pvs-studio-free.dir/main.cpp.o
Building CXX object CMakeFiles/how-to-use-pvs-studio-free.dir/encoding.cpp.o
Building CXX object CMakeFiles/how-to-use-pvs-studio-free.dir/comments.cpp.o
/tmp/how-to-use-pvs-studio-free/comments.cpp:44:5: ошибка: identifier «nullptr» is a keyword in C++11 [-Werror=c++0x-compat]
     while (buf != nullptr && *buf != '\0')
     ^
/tmp/how-to-use-pvs-studio-free/comments.cpp:138:3: ошибка: identifier «constexpr» is a keyword in C++11 [-Werror=c++0x-compat]
   static constexpr size_t MaxSkippedLines = 10;
   ^
/tmp/how-to-use-pvs-studio-free/main.cpp:18:35: фатальная ошибка: experimental/filesystem: Нет такого файла или каталога
#include <experimental/filesystem>
                                   ^
компиляция прервана.
In file included from /tmp/how-to-use-pvs-studio-free/encoding.cpp:4:0:
/tmp/how-to-use-pvs-studio-free/encoding.h:9:1: ошибка: scoped enums only available with -std=c++11 or -std=gnu++11 [-Werror]
enum class Encoding
^
/tmp/how-to-use-pvs-studio-free/encoding.cpp: В функции-члене «void Utf16Iterator::operator++()»:
/tmp/how-to-use-pvs-studio-free/encoding.cpp:56:25: ошибка: «Encoding» is not a class or namespace
       if (m_encoding == Encoding::UTF16LE)
                         ^
/tmp/how-to-use-pvs-studio-free/encoding.cpp: В функции «Encoding DetermineEncoding(const char*, size_t, size_t&)»:
/tmp/how-to-use-pvs-studio-free/encoding.cpp:101:6: ошибка: «Encoding» is not a class or namespace
     {Encoding::UTF8,    {0xEF, 0xBB, 0xBF}, 3},
      ^
/tmp/how-to-use-pvs-studio-free/encoding.cpp:102:6: ошибка: «Encoding» is not a class or namespace
     {Encoding::UTF16BE, {0xFE, 0xFF},       2},
      ^
/tmp/how-to-use-pvs-studio-free/encoding.cpp:103:6: ошибка: «Encoding» is not a class or namespace
     {Encoding::UTF16LE, {0xFF, 0xFE},       2},
      ^
/tmp/how-to-use-pvs-studio-free/encoding.cpp:106:23: ошибка: «Encoding» is not a class or namespace
   Encoding encoding = Encoding::UTF8;
                       ^
/tmp/how-to-use-pvs-studio-free/encoding.cpp:109:25: ошибка: range-based «for» loops are not allowed in C++98 mode
   for (const BOM &bom : boms)
                         ^
/tmp/how-to-use-pvs-studio-free/encoding.cpp: В функции «void ConvertEncoding(std::string&, Encoding&, size_t&)»:
/tmp/how-to-use-pvs-studio-free/encoding.cpp:138:8: ошибка: «Encoding» is not a class or namespace
   case Encoding::ASCII:
        ^
/tmp/how-to-use-pvs-studio-free/encoding.cpp:139:8: ошибка: «Encoding» is not a class or namespace
   case Encoding::UTF8:
        ^
/tmp/how-to-use-pvs-studio-free/encoding.cpp:146:8: ошибка: «Encoding» is not a class or namespace
   case Encoding::UTF16BE:
        ^
/tmp/how-to-use-pvs-studio-free/encoding.cpp:147:8: ошибка: «Encoding» is not a class or namespace
   case Encoding::UTF16LE:
        ^
/tmp/how-to-use-pvs-studio-free/encoding.cpp:155:11: ошибка: «move» не является элементом «std»
     str = std::move(newStr);

---


diff --git a/CMakeLists.txt b/CMakeLists.txt
index 25956a4..f31464f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -23,7 +23,7 @@ else ()
         set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "")
     endif ()

-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror -Wold-style-cast")
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror -Wold-style-cast -std=gnu++11")

     link_libraries(stdc++fs)
endif ()


/tmp/how-to-use-pvs-studio-free/main.cpp:18:35: фатальная ошибка: experimental/filesystem: Нет такого файла или каталога
#include <experimental/filesystem>
                                ^

Мож ещё всем GCC 6.0 поставить?

Ответить | Правка | Наверх | Cообщить модератору

Оглавление
PVS-Studio доступен для бесплатного использования открытыми ..., opennews, 03-Дек-16, 19:13  [смотреть все]
Форумы | Темы | Пред. тема | След. тема



Партнёры:
PostgresPro
Inferno Solutions
Hosting by Hoster.ru
Хостинг:

Закладки на сайте
Проследить за страницей
Created 1996-2024 by Maxim Chirkov
Добавить, Поддержать, Вебмастеру