Back to the main page.

Bug 3309 - Warning concerning short-circuit operations in Octave

Status ASSIGNED
Reported 2017-06-13 16:04:00 +0200
Modified 2018-11-15 10:26:35 +0100
Product: FieldTrip
Component: octave
Version: unspecified
Hardware: PC
Operating System: Linux
Importance: P5 minor
Assigned to:
URL:
Tags:
Depends on:
Blocks:
See also:

Guillaume - 2017-06-13 16:04:46 +0200

normals.m uses "|" instead of "||" in scalar conditional statements - Octave displays a warning for this ("Matlab-style short-circuit operation performed for operator|"). A full list of functions that use this syntax can be obtained with: f = cellstr(spm_select('FPlistRec','/path/to/fieldtrip','\.m$')); s = checkcode(f); for i=1:numel(s) for j=1:numel(s{i}) if strmatch('Use ||',s{i}(j).message) disp(f{i}); end end end


Robert Oostenveld - 2017-06-13 18:39:22 +0200

that gives me this (after filtering out external) fieldtrip/contrib/nutmegtrip/nmt_sourceplot.m fieldtrip/contrib/spike/ft_spike_select.m fieldtrip/contrib/spike/ft_spike_waveform.m fieldtrip/fileio/private/decode_nifti1.m fieldtrip/fileio/private/ft_datatype_spike.m fieldtrip/fileio/private/inifile.m fieldtrip/fileio/private/read_asa_vol.m fieldtrip/fileio/private/read_biff.m fieldtrip/fileio/private/read_bti_ascii.m fieldtrip/fileio/private/read_ctf_hc.m fieldtrip/fileio/private/read_curry.m fieldtrip/fileio/private/read_polhemus_fil.m fieldtrip/fileio/private/read_yokogawa_header.m fieldtrip/fileio/private/read_yokogawa_header_new.m fieldtrip/forward/private/leadfield_openmeeg.m fieldtrip/forward/private/normals.m fieldtrip/inverse/private/SAM_costfun.m fieldtrip/plotting/private/select3d.m fieldtrip/private/dftfilter.m fieldtrip/private/elec1020_intersect.m fieldtrip/private/normals.m ---> YUP IT IS HERE AS WELL fieldtrip/private/read_ctf_hc.m fieldtrip/private/select3d.m fieldtrip/private/select_channel_list.m fieldtrip/private/volplot.m fieldtrip/realtime/example/ft_realtime_fmriproxy.m fieldtrip/realtime/online_mri/ft_omri_slice_time_init.m fieldtrip/realtime/online_mri/private/rls_init.m fieldtrip/statfun/ft_statfun_depsamplesFmultivariate.m fieldtrip/statfun/ft_statfun_depsamplesFunivariate.m fieldtrip/test/test_ft_channelrepair.m fieldtrip/test/test_ft_checkdata.m fieldtrip/test/private/normals.m fieldtrip/trialfun/private/select_channel_list.m fieldtrip/utilities/ft_datatype_spike.m


Robert Oostenveld - 2017-06-13 18:41:56 +0200

PS cool, I did not know about this checkcode function!


Guillaume - 2017-06-14 10:33:10 +0200

Thanks Robert, that's great! Just a quick comment: in the new function test_checkcode.m, it might be worth using checkcode(...,'-id') and s(j).id in case the wording of error messages changes over time.


Jan-Mathijs Schoffelen - 2018-11-13 22:54:17 +0100

Robert: deze kan dicht, toch?


Robert Oostenveld - 2018-11-15 10:26:35 +0100

@JM: we should ideally still change it such that it uses the msgId rather than the string. The msgId will be more persistent over matlab versions than the string.