[PR #50] [CLOSED] [bit_cost.h] fix "ambiguous call to overloaded function" (C2668) #638

Open
opened 2026-01-29 20:46:33 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/google/brotli/pull/50
Author: @anthrotype
Created: 3/27/2015
Status: Closed

Base: masterHead: ambiguous_log


📝 Commits (1)

  • 83b3f09 [bit_cost.h] fix "ambiguous call to overloaded function" (C2668)

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 enc/bit_cost.h (+1 -1)

📄 Description

Hi,
after commit 534654def1, the encoder fails to compile on MS Visual Studio 2010, with the following error:

c:\userslocal\cosimo.lupo\documents\github\brotli\enc\./bit_cost.h(44) : error C2668: 'log' : ambiguous call to overloaded function
    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\math.h(575): could be 'long double log(long double)'
    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\math.h(527): or       'float log(float)'
    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\math.h(120): or       'double log(double)'
    while trying to match the argument list '(int)'

At line 44 of "bit_cost.h", there is a call to log function: I think the varialbe sum should be cast to double.
Anyway, thanks for your work!

Cosimo


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/google/brotli/pull/50 **Author:** [@anthrotype](https://github.com/anthrotype) **Created:** 3/27/2015 **Status:** ❌ Closed **Base:** `master` ← **Head:** `ambiguous_log` --- ### 📝 Commits (1) - [`83b3f09`](https://github.com/google/brotli/commit/83b3f09532780cb550cef8767fad0d623c8d8434) [bit_cost.h] fix "ambiguous call to overloaded function" (C2668) ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `enc/bit_cost.h` (+1 -1) </details> ### 📄 Description Hi, after commit 534654def1f7b858e6f24f895609e51e19a19580, the encoder fails to compile on MS Visual Studio 2010, with the following error: ``` c:\userslocal\cosimo.lupo\documents\github\brotli\enc\./bit_cost.h(44) : error C2668: 'log' : ambiguous call to overloaded function C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\math.h(575): could be 'long double log(long double)' C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\math.h(527): or 'float log(float)' C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\math.h(120): or 'double log(double)' while trying to match the argument list '(int)' ``` At line 44 of "bit_cost.h", there is a call to `log` function: I think the varialbe `sum` should be cast to double. Anyway, thanks for your work! Cosimo --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 20:46:33 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/brotli#638