* bug 4744 fixed - whereis, librairieslist, libraryinfo primitives should be moved in "functions" modules.
+* bug 4789 fixed - number of input arguments is not checked in ilib_functions (dynamic_link module)
+
* bug 4795 fixed - CallScilab.h renamed call_scilab.h
if ~haveacompiler() then
error(msprintf(gettext('%s: A Fortran or C compiler is required.\n'),'G_make'))
end
+
+ [lhs,rhs] = argn(0);
+ if rhs <> 2 then
+ error(msprintf(gettext("%s: Wrong number of input argument(s).\n"),"G_make"));
+ return
+ end
msg = '';
function cmd = gencompilationflags_unix(ldflags, cflags, fflags, cc)
- // This function is restricted to Linux/Unix user only
+ // This function is restricted to Linux/Unix user only
if MSDOS then
error(msprintf(gettext("%s: Feature not available under Microsoft Windows.\n"),'gencompilationflags_unix'));
return;
end
+
+ [lhs,rhs] = argn(0);
+ if rhs <> 4 then
+ error(msprintf(gettext("%s: Wrong number of input argument(s).\n"),"gencompilationflags_unix"));
+ return
+ end
cmd=''
// CFLAGS
// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
// Copyright (C) ENPC/INRIA
-// Copyright (C) DIGITEO - 2009 - Allan CORNEt
+// Copyright (C) DIGITEO - 2009 - Allan CORNET
//
// This file must be used under the terms of the CeCILL.
// This source file is licensed as described in the file COPYING, which
if ~haveacompiler() then
error(msprintf(gettext("%s: A Fortran or C compiler is required.\n"),'ilib_build'));
- return;
+ return;
end
[lhs,rhs] = argn(0);
-
+ if rhs < 4 then
+ error(msprintf(gettext("%s: Wrong number of input argument(s).\n"),"ilib_build"));
+ return
+ end
+
if type(ilib_name) <> 10 then
error(999,msprintf(_("%s: Wrong type for input argument #%d: A string expected.\n"),'ilib_build',1));
end
cc)
+ [lhs,rhs] = argn(0);
+ if rhs < 3 then
+ error(msprintf(gettext("%s: Wrong number of input argument(s).\n"),"ilib_compile"));
+ return
+ end
+
libn=""; //** init variable
if ~haveacompiler() then
cc)
[lhs,rhs] = argn(0);
+ if rhs < 4 then
+ error(msprintf(gettext("%s: Wrong number of input argument(s).\n"),"ilib_for_link"));
+ return
+ end
if rhs <= 4 then makename = "Makelib";end
if rhs <= 5 then loadername = "loader.sce";end
//------------------------------------
// generate a Makefile for gateway
+ [lhs,rhs] = argn(0);
+ if rhs < 4 then
+ error(msprintf(gettext("%s: Wrong number of input argument(s).\n"), "ilib_gen_Make"));
+ return
+ end
+
if argn(2)<6 then with_gateway=%t,ldflags='',cflags='',fflags='', cc='';end
for i=1:size(files,'*') // compatibility scilab 4.x
[path_f, file_f, ext_f] = fileparts(files(i));
function gateway_filename = ilib_gen_gateway(name,tables)
+ [lhs,rhs] = argn(0);
+ if rhs <> 2 then
+ error(msprintf(gettext("%s: Wrong number of input argument(s).\n"), "ilib_gen_gateway"));
+ return
+ end
+
gateway_filename = '';
k = strindex(name,['/','\']);
if k~=[] then
return;
end
- [lhs,rhs]=argn(0);
+ [lhs,rhs] = argn(0);
+ if rhs < 4 then
+ error(msprintf(gettext("%s: Wrong number of input argument(s).\n"),"ilib_mex_build"));
+ return
+ end
if rhs <= 4 then makename = 'Makelib';end
if rhs <= 5 then ldflags = ''; end
--- /dev/null
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2009 - DIGITEO - Allan CORNET
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+// <-- JVM NOT MANDATORY -->
+// <-- Non-regression test for bug 4789 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/show_bug.cgi?id=4789
+//
+// <-- Short Description -->
+// number of input arguments is not checked in ilib_xxx functions
+ierr = execstr("l=ilib_for_link(''rosenf'',[''adStack.c'',''adBuffer.f'',''rosenf_b.f'']);","errcatch");
+if ierr <> 10000 then bugmes();quit;end
+ierr = execstr("ilib_mex_build();","errcatch");
+if ierr <> 10000 then bugmes();quit;end
+ierr = execstr("ilib_gen_Make();","errcatch");
+if ierr <> 10000 then bugmes();quit;end
+ierr = execstr("ilib_gen_gateway();","errcatch");
+if ierr <> 10000 then bugmes();quit;end
+ierr = execstr("ilib_compile();","errcatch");
+if ierr <> 10000 then bugmes();quit;end
+ierr = execstr("ilib_build();","errcatch");
+if ierr <> 10000 then bugmes();quit;end
+ierr = execstr("G_make();","errcatch");
+if ierr <> 10000 then bugmes();quit;end
+ierr = execstr("gencompilationflags_unix();","errcatch");
+if ierr <> 10000 then bugmes();quit;end
--- /dev/null
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2009 - DIGITEO - Allan CORNET
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+
+// <-- JVM NOT MANDATORY -->
+
+// <-- Non-regression test for bug 4789 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/show_bug.cgi?id=4789
+//
+// <-- Short Description -->
+// number of input arguments is not checked in ilib_xxx functions
+
+ierr = execstr("l=ilib_for_link(''rosenf'',[''adStack.c'',''adBuffer.f'',''rosenf_b.f'']);","errcatch");
+if ierr <> 10000 then pause,end
+
+ierr = execstr("ilib_mex_build();","errcatch");
+if ierr <> 10000 then pause,end
+
+ierr = execstr("ilib_gen_Make();","errcatch");
+if ierr <> 10000 then pause,end
+
+ierr = execstr("ilib_gen_gateway();","errcatch");
+if ierr <> 10000 then pause,end
+
+ierr = execstr("ilib_compile();","errcatch");
+if ierr <> 10000 then pause,end
+
+ierr = execstr("ilib_build();","errcatch");
+if ierr <> 10000 then pause,end
+
+ierr = execstr("G_make();","errcatch");
+if ierr <> 10000 then pause,end
+
+ierr = execstr("gencompilationflags_unix();","errcatch");
+if ierr <> 10000 then pause,end
+