[mythtv] [mythtv-commits] mythtv/master commit: c7b18dbc4 by Daniel Kristjansson (daniel-kristjansson)

Jonathan Martens jonathan at snetram.nl
Tue Aug 23 20:57:49 UTC 2011


On 23-8-2011 16:27, MythTV wrote:
>        Author:  Daniel Kristjansson<danielk at cuymedia.net>
>   Change Date:  2011-08-23T07:25:28-07:00
>     Push Date:  2011/08/23 07:27:04 -0700
>    Repository:  mythtv
>        Branch:  master
> New Revision:  c7b18dbc495f539cf4ed80525c09539d9061f977
>     Changeset:  https://github.com/MythTV/mythtv/commit/c7b18dbc4
>
> Log:
>
> Convert MINGW random() to use rand_s.

This should be reverted or redone in a different version as MinGW does 
not have rand_s().

According to MSDN documentation [2] which is referenced from the 
rand_s() documentation [1] it is not that bad to keep using srand or rand:

"Significant enhancements have been made to make the CRT more secure. 
Many CRT functions now have more secure versions. If a new secure 
function exists, the older, less secure version is marked as deprecated 
and the new version has the _s ("secure") suffix.

It should be noted that in this context, "deprecated" just means that a 
function's use is not recommended; it does not indicate that the 
function is scheduled to be removed from the CRT.

It should also be noted that the secure functions do not prevent or 
correct security errors; rather, they catch errors when they occur. They 
perform additional checks for error conditions, and in the case of an 
error, they invoke an error handler (see Parameter Validation)."

Any changes this gets reverted or fixed in a different way? On windows 
build now brakes with:

make[2]: Leaving directory 
`/d/buildbot-data/snetram-winxp-32bit/master-winxp-32bit/build/mythtv/libs/libmythfreesurround'
make[1]: Leaving directory 
`/d/buildbot-data/snetram-winxp-32bit/master-winxp-32bit/build/mythtv/libs'
In file included from freesurround.cpp:31:0:
../libmythbase/compat.h: In function 'long int random()':
../libmythbase/compat.h:129:23: error: 'rand_s' was not declared in this 
scope
make[2]: *** [freesurround.o] Error 1
make[1]: *** [sub-libmythfreesurround-make_default] Error 2
make: *** [libs] Error 2
program finished with exit code 2

I am afraid that this is the first in a line of things braking windows 
compilation as before I did a 'make distclean' I already observed this 
error:

In file included from mythcorecontext.cpp:22:0:
compat.h: In function 'long int random()':
compat.h:133:35: warning: left shift count >= width of type
mythcorecontext.cpp: In constructor 
'MythCoreContextPrivate::MythCoreContextPrivate(MythCoreContext*, 
QString, QObject*)':
mythcorecontext.cpp:100:40: error: 'srandom' was not declared in this scope
mythcorecontext.cpp: In member function 'void 
MythCoreContext::dispatchNow(const MythEvent&)':
mythcorecontext.cpp:1047:38: warning: 'void 
MythObservable::dispatchNow(const MythEvent&)' is deprecated (declared 
at mythobservable.h:21)
make[2]: *** [mythcorecontext.o] Error 1
make[1]: *** [sub-libmythbase-make_default] Error 2
make: *** [libs] Error 2

Kind regards,

Jonathan

[1] http://msdn.microsoft.com/en-us/library/sxtz2fa8%28VS.80%29.aspx
[2] http://msdn.microsoft.com/en-us/library/sxtz2fa8%28VS.80%29.aspx


More information about the mythtv-dev mailing list