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

Lots of "comparison of integers of different signs" warnings on install. #4

Closed
erictaylor opened this issue Jun 26, 2015 · 6 comments
Closed

Comments

@erictaylor
Copy link
Collaborator

Installing on Mac OS X 10.10.3 and Node v0.12.5 produces lots of the following warnings (still installs and builds correctly), but is dirty and loud.

Example:

In file included from ../csrc/enc/metablock.cc:21:
../csrc/enc/./cluster.h:129:36: warning: comparison of integers of different signs: 'int' and 'size_type' (aka 'unsigned long') [-Wsign-compare]
    for (int idx2 = idx1 + 1; idx2 < clusters.size(); ++idx2) {
                              ~~~~ ^ ~~~~~~~~~~~~~~~
../csrc/enc/./cluster.h:135:26: warning: comparison of integers of different signs: 'size_type' (aka 'unsigned long') and 'int' [-Wsign-compare]
  while (clusters.size() > min_cluster_size) {
         ~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~
../csrc/enc/./cluster.h:152:27: warning: comparison of integers of different signs: 'int' and 'size_type' (aka 'unsigned long') [-Wsign-compare]
    for (int i = 0; i + 1 < clusters.size(); ++i) {
                    ~~~~~ ^ ~~~~~~~~~~~~~~~
../csrc/enc/./cluster.h:159:23: warning: comparison of integers of different signs: 'int' and 'size_type' (aka 'unsigned long') [-Wsign-compare]
    for (int i = 0; i < pairs.size(); ++i) {
                    ~ ^ ~~~~~~~~~~~~
../csrc/enc/./cluster.h:172:23: warning: comparison of integers of different signs: 'int' and 'size_type' (aka 'unsigned long') [-Wsign-compare]
    for (int i = 0; i < clusters.size(); ++i) {
                    ~ ^ ~~~~~~~~~~~~~~~
../csrc/enc/./cluster.h:234:21: warning: comparison of integers of different signs: 'int' and 'size_type' (aka 'unsigned long') [-Wsign-compare]
  for (int i = 0; i < symbols->size(); ++i) {
                  ~ ^ ~~~~~~~~~~~~~~~
../csrc/enc/./cluster.h:300:3: note: in instantiation of function template specialization 'brotli::HistogramReindex<brotli::Histogram<256> >' requested here
  HistogramReindex(out, histogram_symbols);
  ^
../csrc/enc/metablock.cc:71:5: note: in instantiation of function template specialization 'brotli::ClusterHistograms<brotli::Histogram<256> >' requested here
    ClusterHistograms(literal_histograms,
    ^
In file included from ../csrc/enc/metablock.cc:21:
../csrc/enc/./cluster.h:242:21: warning: comparison of integers of different signs: 'int' and 'size_type' (aka 'unsigned long') [-Wsign-compare]
  for (int i = 0; i < symbols->size(); ++i) {
                  ~ ^ ~~~~~~~~~~~~~~~
../csrc/enc/./cluster.h:128:27: warning: comparison of integers of different signs: 'int' and 'size_type' (aka 'unsigned long') [-Wsign-compare]
  for (int idx1 = 0; idx1 < clusters.size(); ++idx1) {
                     ~~~~ ^ ~~~~~~~~~~~~~~~
../csrc/enc/./cluster.h:285:7: note: in instantiation of function template specialization 'brotli::HistogramCombine<brotli::Histogram<520> >' requested here
      HistogramCombine(&(*out)[0], &cluster_size[0],
      ^
../csrc/enc/metablock.cc:88:5: note: in instantiation of function template specialization 'brotli::ClusterHistograms<brotli::Histogram<520> >' requested here
    ClusterHistograms(distance_histograms,
    ^
In file included from ../csrc/enc/metablock.cc:21:
../csrc/enc/./cluster.h:129:36: warning: comparison of integers of different signs: 'int' and 'size_type' (aka 'unsigned long') [-Wsign-compare]
    for (int idx2 = idx1 + 1; idx2 < clusters.size(); ++idx2) {
                              ~~~~ ^ ~~~~~~~~~~~~~~~
../csrc/enc/./cluster.h:135:26: warning: comparison of integers of different signs: 'size_type' (aka 'unsigned long') and 'int' [-Wsign-compare]
  while (clusters.size() > min_cluster_size) {
         ~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~
../csrc/enc/./cluster.h:152:27: warning: comparison of integers of different signs: 'int' and 'size_type' (aka 'unsigned long') [-Wsign-compare]
    for (int i = 0; i + 1 < clusters.size(); ++i) {
                    ~~~~~ ^ ~~~~~~~~~~~~~~~
../csrc/enc/./cluster.h:159:23: warning: comparison of integers of different signs: 'int' and 'size_type' (aka 'unsigned long') [-Wsign-compare]
    for (int i = 0; i < pairs.size(); ++i) {
                    ~ ^ ~~~~~~~~~~~~
../csrc/enc/./cluster.h:172:23: warning: comparison of integers of different signs: 'int' and 'size_type' (aka 'unsigned long') [-Wsign-compare]
    for (int i = 0; i < clusters.size(); ++i) {
                    ~ ^ ~~~~~~~~~~~~~~~
../csrc/enc/./cluster.h:234:21: warning: comparison of integers of different signs: 'int' and 'size_type' (aka 'unsigned long') [-Wsign-compare]
  for (int i = 0; i < symbols->size(); ++i) {
                  ~ ^ ~~~~~~~~~~~~~~~
../csrc/enc/./cluster.h:300:3: note: in instantiation of function template specialization 'brotli::HistogramReindex<brotli::Histogram<520> >' requested here
  HistogramReindex(out, histogram_symbols);
  ^
../csrc/enc/metablock.cc:88:5: note: in instantiation of function template specialization 'brotli::ClusterHistograms<brotli::Histogram<520> >' requested here
    ClusterHistograms(distance_histograms,
    ^
In file included from ../csrc/enc/metablock.cc:21:
../csrc/enc/./cluster.h:242:21: warning: comparison of integers of different signs: 'int' and 'size_type' (aka 'unsigned long') [-Wsign-compare]
  for (int i = 0; i < symbols->size(); ++i) {
                  ~ ^ ~~~~~~~~~~~~~~~
30 warnings generated.
../csrc/enc/streams.cc:38:16: warning: comparison of integers of different signs: 'unsigned long' and 'int' [-Wsign-compare]
  if (n + pos_ > len_)
      ~~~~~~~~ ^ ~~~~
../csrc/enc/streams.cc:59:24: warning: comparison of integers of different signs: 'unsigned long' and 'int' [-Wsign-compare]
  if (buf_->size() + n > max_size_)
      ~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~
../csrc/enc/streams.cc:81:9: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int' [-Wsign-compare]
  if (n > len_ - pos_)
      ~ ^ ~~~~~~~~~~~
3 warnings generated.

Not sure if we can correct these issues, or possibly suppress the noise if they can safely be ignored.

@nfroidure
Copy link
Owner

We can probably hide this with a cflag, have to find it though.

@nfroidure
Copy link
Owner

And, sending an issue to the original woff2 project is also an option, even make a PR if you want.

@vdclouis
Copy link

+1

nfroidure added a commit that referenced this issue Jul 1, 2015
@nfroidure
Copy link
Owner

I found this https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html

I could mute warnings with the -w option on Linux, can someone confirm it works also for MacOSX?

@nfroidure
Copy link
Owner

ping @Psiablo

@nfroidure
Copy link
Owner

Merged and published. Thank you 👍 .

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

No branches or pull requests

3 participants