[FFmpeg-trac] #11103(avutil:new): Compiler error when casting from void* to char*

FFmpeg trac at avcodec.org
Sat Jul 13 09:48:53 EEST 2024


#11103: Compiler error when casting from void* to char*
--------------------------------+--------------------------------------
             Reporter:  v0lt    |                     Type:  defect
               Status:  new     |                 Priority:  normal
            Component:  avutil  |                  Version:  git-master
             Keywords:          |               Blocked By:
             Blocking:          |  Reproduced by developer:  0
Analyzed by developer:  0       |
--------------------------------+--------------------------------------
 After this change
 https://git.ffmpeg.org/gitweb/ffmpeg.git/commitdiff/e9e8bea2e79bc3c481a6f81f75f6c871e3e0f367?hp=628ba061c8d5ae018c3e8aa8ce05b8dfcdfd8410
 I get an error (сompiler MSVC 19.39.33523):
 {{{
 ffmpeg\libavutil\wchar_filename.h(60,32): error C2440: '=': cannot convert
 from 'void *' to 'char *'
 }}}
 I explicitly cast the result of the av_malloc_array function to char* and
 there is no more error.
 {{{
 *filename = (char*)av_malloc_array(num_chars, sizeof **filename);
 }}}
 Please make an explicit cast from void* to char*.
-- 
Ticket URL: <https://trac.ffmpeg.org/ticket/11103>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list