Commit Graph

12 Commits

Author SHA1 Message Date
Hans Wennborg
55f6115f80 Remove mentions of -Wweak-template-vtables
the Clang warning is being removed, see bug.

Bug: chromium:1264351, chromium:1294786
Change-Id: I206f1c891f722cd906fd357176c9f68778e0861f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/464616
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2022-02-08 13:55:28 +00:00
John Stiles
89ddd74f80 Enable warning -Wunneeded-internal-declaration.
When we set -Wno-unused-template, this also implicitly disables the
related warning flag -Wunneeded-internal-declaration:
http://screen/5WX2Js6YYYyTb6g

Fixing -Wno-unused-template is nontrivial, but we can just reenable the
warning we care about on the next line.

This warning is triggered by Android builds so it's important to enable
it to prevent blocking the Android roll.
Context: http://review.skia.org/504416

Change-Id: I7e68608beb46dc69a4685c1b13680b97fc9f1cef
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/505299
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2022-02-07 22:22:14 +00:00
John Stiles
b73789dc4a Reland "Reenable unreachable-code warnings."
This is a reland of b292c30aa0

This CL also addresses the Wuffs-specific unreachable code.

Original change's description:
> Reenable unreachable-code warnings.
>
> Change-Id: Ie56967a4b823388f0975384e88be23ff2fceecf7
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/504598
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: John Stiles <johnstiles@google.com>
> Auto-Submit: John Stiles <johnstiles@google.com>

Change-Id: I655db50134e0de0d0448f22b636ba027513e28f4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/504757
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2022-02-07 14:56:09 +00:00
John Stiles
7dda12a88a Revert "Reenable unreachable-code warnings."
This reverts commit b292c30aa0.

Reason for revert: breaks Wuffs build

Original change's description:
> Reenable unreachable-code warnings.
>
> Change-Id: Ie56967a4b823388f0975384e88be23ff2fceecf7
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/504598
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: John Stiles <johnstiles@google.com>
> Auto-Submit: John Stiles <johnstiles@google.com>

Change-Id: I3844f535b3940a0408f0896ddf7ae9894328cba3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/504756
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2022-02-04 22:50:10 +00:00
John Stiles
b292c30aa0 Reenable unreachable-code warnings.
Change-Id: Ie56967a4b823388f0975384e88be23ff2fceecf7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/504598
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2022-02-04 21:45:43 +00:00
John Stiles
2cf4863add Upgrade from C++14 to C++17.
Change-Id: Ib11a528f41a4a1d5d8eb4c11ff95d88a50f019ff
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/500898
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2022-01-27 15:58:10 +00:00
Leandro Lovisolo
b34e97b5d9 Add Android HWAddress Sanitizer tasks.
Design doc: http://go/skia-android-hwasan.

This CL defines the following tasks:

- Build-Debian10-Clang-arm64-Debug-Android_HWASAN
- Test-Android-Clang-Pixel4a-CPU-Snapdragon730G-arm64-Debug-All-Android_HWASAN
- Test-Android-Clang-Pixel4a-GPU-Adreno618-arm64-Debug-All-Android_HWASAN

The HWAddress Sanitizer is only available on 64-bit Arm devices, and requires Android 10+ built with HWAddress Sanitizer support. There are prebuilt HWASan images for supported Pixel devices at https://ci.android.com (instructions at https://developer.android.com/ndk/guides/hwasan).

To support these tasks, we added two Pixel 4a devices to the tree, flashed with the corresponding prebuilt HWASan image. The specific Pixel devices were chosen based on stock availability.

See patchset 11 for an example error I introduced in //gm/3d.cpp, which was caught by the HWAddress Sanitizer.

Bug: skia:12099
Change-Id: Ic3847abc61c8a1bf686d29b97ef9d89b9bb5eb86
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/436572
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
Commit-Queue: Leandro Lovisolo <lovisolo@google.com>
2021-10-21 15:22:44 +00:00
Brian Salomon
87a0078b89 Support building on clang with -std=c++14 but no C++17 extension warning.
Classes of issues addressed:

1. static constexpr class variables aren't automatically inline. Already handled in a separate CL

2. Lack of C++17 copy elision means classes of objects constructed at function return need a copy or move constructor even if RVO will mean it isn't called.

3. Nested braced init no longer allowed for base classes of subclasses without constructors.

4. template static constexpr var in template class throws error about redundant initialization. Adding inline and removing defn outside of class fixes it.

5. Some places that should have been including std headers now actually need to include them.

6. No auto template parameters.

7. No lambdas in constexpr funcs.


Bug: chromium:1257145
Change-Id: Icb24c6b4ed039287fb4cf27a21a1bb7dc9821728
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/457298
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2021-10-12 16:34:30 +00:00
John Stiles
7d99ba2503 Enable variable-shadow warnings.
This will prevent us from reusing a variable name from an outer scope
within an inner scope; this is a common source of confusion or bugs.
There are two special cases where shadowing is still allowed.

- Constructor arguments that match class member variables, e.g.:

    MyCtor(int value) : value(value) {}

- Lambdas where the outside variable is not accessible in the inner
  scope, e.g.:

    void Fn(int x) {
        auto lambda = [] { int x = 123; };  /* outer x not captured */
    }

Change-Id: I073bdaf7c530fc958fc13ce68464cf345a2f5358
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/439497
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2021-08-16 18:06:06 +00:00
Kevin Lubick
c3aa2f05cf Address some compile warnings from Clang 13
The latest emscripten uses Clang 13, which points out some new warnings
about implicit copy constructors, copy assignment operators etc.

This addresses some that I found until llvm crashed and would not
compile further (https://bugs.llvm.org/show_bug.cgi?id=50408)

Change-Id: Ia4d3f0b308facb18bf2da50261326244a7848644
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/413056
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2021-06-15 18:58:18 +00:00
Ben Wagner
7d8cdd5b7f Remove use of std::result_of.
std::result_of is deprecated and removed in C++20, std::invoke_result is
in C++17 the library so not ready yet.

In the case of SkMakeArray there is no need for the full power of
std::invoke_result as SFINAE is not needed, nor is calling a method
supported. As a result a simple decltype is sufficient.

Bug: skia:11811
Change-Id: I6c07c380970cc2a991ab8bd457997320ba634e6c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/390476
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2021-03-30 16:57:45 +00:00
Ben Wagner
3d9ab7e7ec Separate general defaults from Skia defaults
In the build there are some defaults which actually apply to every
use of a built-in target type, but there are some (particularaly
warnings) which apply only to targets controlled by Skia. Currently
these unwanted defaults are magically known to exist and removed
wherever they are not wanted. Instead, create 'skia_' prefixed target
templates and apply these defaults to those instead.

Change-Id: I3a2afb53c7205a2e2748d1cfad46319f2e93d3b3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/385516
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2021-03-22 15:30:56 +00:00