Opened 10 years ago

Closed 10 years ago

#7817 closed Bugs (wontfix)

Many warnings during compile time

Reported by: olgood@… Owned by: viboes
Milestone: Component: thread
Version: Boost 1.52.0 Severity: Cosmetic
Keywords: Cc:

Description

MinGW 4.7.2

gcc.compile.c++ bin.v2\libs\thread\build\gcc-mingw-4.7.2\release\link-static\threading-multi\win32\thread.o
In file included from ./boost/thread/shared_mutex.hpp:18:0,
                 from ./boost/thread/detail/thread_group.hpp:9,
                 from ./boost/thread/thread.hpp:24,
                 from libs\thread\src\win32\thread.cpp:15:
./boost/thread/win32/shared_mutex.hpp: In constructor 'boost::shared_mutex::shared_mutex()':
./boost/thread/win32/shared_mutex.hpp:98:33: warning: missing initializer for member 'boost::shared_mutex::state_data::shared_waiting' [-Wmissing
-field-initializers]
./boost/thread/win32/shared_mutex.hpp:98:33: warning: missing initializer for member 'boost::shared_mutex::state_data::exclusive' [-Wmissing-fiel
d-initializers]
./boost/thread/win32/shared_mutex.hpp:98:33: warning: missing initializer for member 'boost::shared_mutex::state_data::upgrade' [-Wmissing-field-
initializers]
./boost/thread/win32/shared_mutex.hpp:98:33: warning: missing initializer for member 'boost::shared_mutex::state_data::exclusive_waiting' [-Wmiss
ing-field-initializers]
./boost/thread/win32/shared_mutex.hpp:98:33: warning: missing initializer for member 'boost::shared_mutex::state_data::exclusive_waiting_blocked'
 [-Wmissing-field-initializers]
libs\thread\src\win32\thread.cpp: In static member function 'static unsigned int boost::thread::hardware_concurrency()':
libs\thread\src\win32\thread.cpp:390:30: warning: missing initializer for member '_SYSTEM_INFO::dwPageSize' [-Wmissing-field-initializers]
libs\thread\src\win32\thread.cpp:390:30: warning: missing initializer for member '_SYSTEM_INFO::lpMinimumApplicationAddress' [-Wmissing-field-ini
tializers]
libs\thread\src\win32\thread.cpp:390:30: warning: missing initializer for member '_SYSTEM_INFO::lpMaximumApplicationAddress' [-Wmissing-field-ini
tializers]
libs\thread\src\win32\thread.cpp:390:30: warning: missing initializer for member '_SYSTEM_INFO::dwActiveProcessorMask' [-Wmissing-field-initializ
ers]
libs\thread\src\win32\thread.cpp:390:30: warning: missing initializer for member '_SYSTEM_INFO::dwNumberOfProcessors' [-Wmissing-field-initialize
rs]
libs\thread\src\win32\thread.cpp:390:30: warning: missing initializer for member '_SYSTEM_INFO::dwProcessorType' [-Wmissing-field-initializers]
libs\thread\src\win32\thread.cpp:390:30: warning: missing initializer for member '_SYSTEM_INFO::dwAllocationGranularity' [-Wmissing-field-initial
izers]
libs\thread\src\win32\thread.cpp:390:30: warning: missing initializer for member '_SYSTEM_INFO::wProcessorLevel' [-Wmissing-field-initializers]
libs\thread\src\win32\thread.cpp:390:30: warning: missing initializer for member '_SYSTEM_INFO::wProcessorRevision' [-Wmissing-field-initializers
]
libs\thread\src\win32\thread.cpp: In function 'LARGE_INTEGER boost::this_thread::{anonymous}::get_due_time(const boost::detail::timeout&)':
libs\thread\src\win32\thread.cpp:412:44: warning: missing initializer for member '_LARGE_INTEGER::<anonymous struct>::HighPart' [-Wmissing-field-
initializers]
libs\thread\src\win32\thread.cpp:426:53: warning: missing initializer for member '_SYSTEMTIME::wMonth' [-Wmissing-field-initializers]
libs\thread\src\win32\thread.cpp:426:53: warning: missing initializer for member '_SYSTEMTIME::wDayOfWeek' [-Wmissing-field-initializers]
libs\thread\src\win32\thread.cpp:426:53: warning: missing initializer for member '_SYSTEMTIME::wDay' [-Wmissing-field-initializers]
libs\thread\src\win32\thread.cpp:426:53: warning: missing initializer for member '_SYSTEMTIME::wHour' [-Wmissing-field-initializers]
libs\thread\src\win32\thread.cpp:426:53: warning: missing initializer for member '_SYSTEMTIME::wMinute' [-Wmissing-field-initializers]
libs\thread\src\win32\thread.cpp:426:53: warning: missing initializer for member '_SYSTEMTIME::wSecond' [-Wmissing-field-initializers]
libs\thread\src\win32\thread.cpp:426:53: warning: missing initializer for member '_SYSTEMTIME::wMilliseconds' [-Wmissing-field-initializers]
In file included from ./boost/thread/shared_mutex.hpp:18:0,
                 from ./boost/thread/detail/thread_group.hpp:9,
                 from ./boost/thread/thread.hpp:24,
                 from libs\thread\src\win32\thread.cpp:15:
./boost/thread/win32/shared_mutex.hpp: In instantiation of 'T boost::shared_mutex::interlocked_compare_exchange(T*, T, T) [with T = boost::shared
_mutex::state_data]':
./boost/thread/win32/shared_mutex.hpp:124:103:   required from here
./boost/thread/win32/shared_mutex.hpp:52:99: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
./boost/thread/win32/shared_mutex.hpp:52:99: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
./boost/thread/win32/shared_mutex.hpp:53:52: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
./boost/thread/win32/shared_mutex.hpp:53:52: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]

Attachments (2)

Shared_mutex_error1.png (31.0 KB ) - added by Barnabé Faliu <barnabe.faliu@…> 10 years ago.
Shared_mutex_error2.png (43.2 KB ) - added by Barnabé Faliu <barnabe.faliu@…> 10 years ago.

Download all attachments as: .zip

Change History (16)

comment:1 by viboes, 10 years ago

Owner: changed from Anthony Williams to viboes
Severity: ProblemCosmetic
Status: newassigned

comment:2 by viboes, 10 years ago

Do you have a patch?

comment:3 by viboes, 10 years ago

Please, could you tell me if the warnings appear when you define BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN?

in reply to:  3 comment:4 by anonymous, 10 years ago

Replying to viboes:

Please, could you tell me if the warnings appear when you define BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN?

I eliminated Boost form my project and am unable to reproduce the warnings quickly. It will take a several days. Sorry. Please wait. Or may be somebody other will try to reproduce. As far as I remember they happen during Boost build.

comment:5 by barnabe.faliu@…, 10 years ago

Warnings still appears even if i define BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN

in reply to:  5 comment:6 by olgood@…, 10 years ago

Replying to barnabe.faliu@…:

Warnings still appears even if i define BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN

Could you please provide me a command line which allow me quickly to reproduce the issue on my set too? Thanks.

comment:7 by Barnabé Faliu <barnabe.faliu@…>, 10 years ago

#include <iostream>
#include <boost/thread/thread.hpp>

#define BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN
using namespace std;



int main() {
	cout << "!!!Hello World!!!" << endl; // prints !!!Hello World!!!
	return 0;
}

This is the only lines in my file. I included C:\Boost\boost_1_52_0, added this library path : C:\Boost\boost_1_52_0\lib and thoose libraries : boost_system-mgw47-1_52 boost_thread-mgw47-mt-sd-1_52

by Barnabé Faliu <barnabe.faliu@…>, 10 years ago

Attachment: Shared_mutex_error1.png added

by Barnabé Faliu <barnabe.faliu@…>, 10 years ago

Attachment: Shared_mutex_error2.png added

in reply to:  7 comment:8 by olgood@…, 10 years ago

Thanks.

I remembered that my program was even shorter - just #include <boost/thread/threads.hpp> and main(int,char){}

This gave warnings and one error (I asked about this on StackOverflow).

And I remembered I've just fixed that warnings for my Boost's sources without backup. So, now I'm unable to reproduce the issue because do not have sources.

Hope, now you'll help Boost guys to fix the issue.

Replying to Barnabé Faliu <barnabe.faliu@…>:

#include <iostream>
#include <boost/thread/thread.hpp>

#define BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN
using namespace std;



int main() {
	cout << "!!!Hello World!!!" << endl; // prints !!!Hello World!!!
	return 0;
}

This is the only lines in my file. I included C:\Boost\boost_1_52_0, added this library path : C:\Boost\boost_1_52_0\lib and thoose libraries : boost_system-mgw47-1_52 boost_thread-mgw47-mt-sd-1_52

in reply to:  7 ; comment:9 by anonymous, 10 years ago

But hey! Just noted: seems you have to put define before include. Isn't it?

Replying to Barnabé Faliu <barnabe.faliu@…>:

#include <iostream>
#include <boost/thread/thread.hpp>

#define BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN
using namespace std;



int main() {
	cout << "!!!Hello World!!!" << endl; // prints !!!Hello World!!!
	return 0;
}

This is the only lines in my file. I included C:\Boost\boost_1_52_0, added this library path : C:\Boost\boost_1_52_0\lib and thoose libraries : boost_system-mgw47-1_52 boost_thread-mgw47-mt-sd-1_52

in reply to:  9 ; comment:10 by Barnabé Faliu <barnabe.faliu@…>, 10 years ago

Replying to anonymous:

Problem solved ! Thank you very much

But hey! Just noted: seems you have to put define before include. Isn't it?

Replying to Barnabé Faliu <barnabe.faliu@…>:

#include <iostream>
#include <boost/thread/thread.hpp>

#define BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN
using namespace std;



int main() {
	cout << "!!!Hello World!!!" << endl; // prints !!!Hello World!!!
	return 0;
}

This is the only lines in my file. I included C:\Boost\boost_1_52_0, added this library path : C:\Boost\boost_1_52_0\lib and thoose libraries : boost_system-mgw47-1_52 boost_thread-mgw47-mt-sd-1_52

in reply to:  10 comment:11 by olgood@…, 10 years ago

Therefore, the answer for viboes' question regarding the flag BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN is positive: yes the flag eliminates that warnings.

Replying to Barnabé Faliu <barnabe.faliu@…>:

Replying to anonymous:

Problem solved ! Thank you very much

But hey! Just noted: seems you have to put define before include. Isn't it?

Replying to Barnabé Faliu <barnabe.faliu@…>:

#include <iostream>
#include <boost/thread/thread.hpp>

#define BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN
using namespace std;



int main() {
	cout << "!!!Hello World!!!" << endl; // prints !!!Hello World!!!
	return 0;
}

This is the only lines in my file. I included C:\Boost\boost_1_52_0, added this library path : C:\Boost\boost_1_52_0\lib and thoose libraries : boost_system-mgw47-1_52 boost_thread-mgw47-mt-sd-1_52

comment:12 by viboes, 10 years ago

On 1.54, I would define BOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN by default as I don't see any regression on it.

Unfortunately I don't think this merits the change in 1.53 given the advanced state of the release.

Could I close this ticket then?

comment:13 by Barnabé Faliu <barnabe.faliu@…>, 10 years ago

Yes you can close it ! Thanks again for your help

comment:14 by viboes, 10 years ago

Milestone: To Be Determined
Resolution: wontfix
Status: assignedclosed

Conclusion: I won't fix as an acceptable alternative exists.

Note: See TracTickets for help on using tickets.