GSoC Project | Basic Support for Trace Compass
Ravindra Kumar Meena
rmeena840 at gmail.com
Mon Jul 8 06:53:47 UTC 2019
>
> > I used GCC 8.3.0.
>
> I see this error also with GCC 8:
>
> /usr/bin/gcc-8 -O2 misc/record/record-main.c -I misc/record -Wall
> misc/record/record-main.c: In function ‘main’:
> misc/record/record-main.c:135:30: warning: ‘input_file’ may be used
> uninitialized in this function [-Wmaybe-uninitialized]
> fd = ( input_file_flag ) ? open( input_file, O_RDONLY ) :
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
> misc/record/record-main.c:278:15: note: ‘input_file’ was declared here
> const char *input_file;
> ^~~~~~~~~~
>
> This is really very strange. GCC on my machine shows some other warnings
but not that one.
> Anyway, could you please fix this warning. The input_file may be in fact
> uninitialized.
>
Yes. I would definitely like to fix this warning but how will I test my
code changes if I don't see the warnings. All the warning that you have
shown to me till now have one thing in common. They are all uninitialized.
I don't know why GCC on my machine is not able to report that.
We can do one thing. I will make changes here and I will push it on my
workplace. You build it and let me know if it still gives warning.
> >
> > I have attached the configure and build process in txt file. Please find
> > them both below.
>
> What is the output for the record-main.c if you use "./waf -v".
>
I get this on "./waf -v"
Waf: Entering directory `/home/ravindra/sandbox/rtems-tools/build'
Fix the typo 'uses' -> 'use' on bld(target='elf', idx=5, tg_idx_count=5,
meths=[], install_path=None,
includes=['/home/ravindra/sandbox/rtems-tools/build',
'elftoolchain/libelf', 'elftoolchain/common'],
source=['elftoolchain/libelf/elf.c', 'elftoolchain/libelf/elf_begin.c',
'elftoolchain/libelf/elf_cntl.c', 'elftoolchain/libelf/elf_end.c',
'elftoolchain/libelf/elf_errmsg.c', 'elftoolchain/libelf/elf_errno.c',
'elftoolchain/libelf/elf_data.c', 'elftoolchain/libelf/elf_fill.c',
'elftoolchain/libelf/elf_flag.c', 'elftoolchain/libelf/elf_getarhdr.c',
'elftoolchain/libelf/elf_getarsym.c', 'elftoolchain/libelf/elf_getbase.c',
'elftoolchain/libelf/elf_getident.c', 'elftoolchain/libelf/elf_hash.c',
'elftoolchain/libelf/elf_kind.c', 'elftoolchain/libelf/elf_memory.c',
'elftoolchain/libelf/elf_next.c', 'elftoolchain/libelf/elf_open.c',
'elftoolchain/libelf/elf_rand.c', 'elftoolchain/libelf/elf_rawfile.c',
'elftoolchain/libelf/elf_phnum.c', 'elftoolchain/libelf/elf_shnum.c',
'elftoolchain/libelf/elf_shstrndx.c', 'elftoolchain/libelf/elf_scn.c',
'elftoolchain/libelf/elf_strptr.c', 'elftoolchain/libelf/elf_update.c',
'elftoolchain/libelf/elf_version.c', 'elftoolchain/libelf/gelf_cap.c',
'elftoolchain/libelf/gelf_checksum.c', 'elftoolchain/libelf/gelf_dyn.c',
'elftoolchain/libelf/gelf_ehdr.c', 'elftoolchain/libelf/gelf_getclass.c',
'elftoolchain/libelf/gelf_fsize.c', 'elftoolchain/libelf/gelf_move.c',
'elftoolchain/libelf/gelf_phdr.c', 'elftoolchain/libelf/gelf_rel.c',
'elftoolchain/libelf/gelf_rela.c', 'elftoolchain/libelf/gelf_shdr.c',
'elftoolchain/libelf/gelf_sym.c', 'elftoolchain/libelf/gelf_syminfo.c',
'elftoolchain/libelf/gelf_symshndx.c', 'elftoolchain/libelf/gelf_xlate.c',
'elftoolchain/libelf/libelf_align.c',
'elftoolchain/libelf/libelf_allocate.c', 'elftoolchain/libelf/libelf_ar.c',
'elftoolchain/libelf/libelf_ar_util.c',
'elftoolchain/libelf/libelf_checksum.c',
'elftoolchain/libelf/libelf_data.c', 'elftoolchain/libelf/libelf_ehdr.c',
'elftoolchain/libelf/libelf_extended.c',
'elftoolchain/libelf/libelf_memory.c', 'elftoolchain/libelf/libelf_open.c',
'elftoolchain/libelf/libelf_phdr.c', 'elftoolchain/libelf/libelf_shdr.c',
'elftoolchain/libelf/libelf_xlate.c', 'libelf_convert.c', 'libelf_fsize.c',
'libelf_msize.c'], cflags=['-O2', '-g', '-pipe'],
uses=['native-elf-format'],
path=/home/ravindra/sandbox/rtems-tools/rtemstoolkit, typ='stlib',
features=['c', 'c', 'cstlib']) in
/home/ravindra/sandbox/rtems-tools/rtemstoolkit
Fix the typo 'uses' -> 'use' on bld(target='elf', idx=5, tg_idx_count=5,
meths=[], install_path=None,
includes=['/home/ravindra/sandbox/rtems-tools/build',
'elftoolchain/libelf', 'elftoolchain/common'],
source=['elftoolchain/libelf/elf.c', 'elftoolchain/libelf/elf_begin.c',
'elftoolchain/libelf/elf_cntl.c', 'elftoolchain/libelf/elf_end.c',
'elftoolchain/libelf/elf_errmsg.c', 'elftoolchain/libelf/elf_errno.c',
'elftoolchain/libelf/elf_data.c', 'elftoolchain/libelf/elf_fill.c',
'elftoolchain/libelf/elf_flag.c', 'elftoolchain/libelf/elf_getarhdr.c',
'elftoolchain/libelf/elf_getarsym.c', 'elftoolchain/libelf/elf_getbase.c',
'elftoolchain/libelf/elf_getident.c', 'elftoolchain/libelf/elf_hash.c',
'elftoolchain/libelf/elf_kind.c', 'elftoolchain/libelf/elf_memory.c',
'elftoolchain/libelf/elf_next.c', 'elftoolchain/libelf/elf_open.c',
'elftoolchain/libelf/elf_rand.c', 'elftoolchain/libelf/elf_rawfile.c',
'elftoolchain/libelf/elf_phnum.c', 'elftoolchain/libelf/elf_shnum.c',
'elftoolchain/libelf/elf_shstrndx.c', 'elftoolchain/libelf/elf_scn.c',
'elftoolchain/libelf/elf_strptr.c', 'elftoolchain/libelf/elf_update.c',
'elftoolchain/libelf/elf_version.c', 'elftoolchain/libelf/gelf_cap.c',
'elftoolchain/libelf/gelf_checksum.c', 'elftoolchain/libelf/gelf_dyn.c',
'elftoolchain/libelf/gelf_ehdr.c', 'elftoolchain/libelf/gelf_getclass.c',
'elftoolchain/libelf/gelf_fsize.c', 'elftoolchain/libelf/gelf_move.c',
'elftoolchain/libelf/gelf_phdr.c', 'elftoolchain/libelf/gelf_rel.c',
'elftoolchain/libelf/gelf_rela.c', 'elftoolchain/libelf/gelf_shdr.c',
'elftoolchain/libelf/gelf_sym.c', 'elftoolchain/libelf/gelf_syminfo.c',
'elftoolchain/libelf/gelf_symshndx.c', 'elftoolchain/libelf/gelf_xlate.c',
'elftoolchain/libelf/libelf_align.c',
'elftoolchain/libelf/libelf_allocate.c', 'elftoolchain/libelf/libelf_ar.c',
'elftoolchain/libelf/libelf_ar_util.c',
'elftoolchain/libelf/libelf_checksum.c',
'elftoolchain/libelf/libelf_data.c', 'elftoolchain/libelf/libelf_ehdr.c',
'elftoolchain/libelf/libelf_extended.c',
'elftoolchain/libelf/libelf_memory.c', 'elftoolchain/libelf/libelf_open.c',
'elftoolchain/libelf/libelf_phdr.c', 'elftoolchain/libelf/libelf_shdr.c',
'elftoolchain/libelf/libelf_xlate.c', 'libelf_convert.c', 'libelf_fsize.c',
'libelf_msize.c'], cflags=['-O2', '-g', '-pipe'],
uses=['native-elf-format'],
path=/home/ravindra/sandbox/rtems-tools/rtemstoolkit, typ='stlib',
features=['c', 'c', 'cstlib']) in
/home/ravindra/sandbox/rtems-tools/rtemstoolkit
Waf: Leaving directory `/home/ravindra/sandbox/rtems-tools/build'
'build' finished successfully (0.569s)
--
*Ravindra Kumar Meena*,
B. Tech. Computer Science and Engineering,
Indian Institute of Technology (Indian School of Mines)
<https://www.iitism.ac.in/>, Dhanbad
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20190708/75825e40/attachment-0002.html>
More information about the devel
mailing list