-----Original Message-----
From: Magnus Fromreide [mailto:ma...@lysator.liu.se] 
Sent: 05 September 2012 02:36
To: Jatin Bodarya
Cc: net-snmp-coders@lists.sourceforge.net
Subject: Re: Mib2C generated code error..

On Tue, 2012-09-04 at 17:08 +0530, Jatin Bodarya wrote:
> Hello DEVs, Please help me
> 
> In my mib2c generated code I cannot write any function which returns a value
> !!!!
> 
> For examples some of the warning are given below..
> Please help me, How can I resolve it ??
> 
> Thanks in advance..
> 
> ionline.c: In function 'handle_memory':
> ionline.c:869:8: warning: ignoring return value of 'system', declared with
> attribute warn_unused_result [-Wunused-result]
> ionline.c:874:8: warning: ignoring return value of 'fscanf', declared with
> attribute warn_unused_result [-Wunused-result]

These warnings are quite clear - read them!

Further, the code mib2c generates calls neither 'system' nor 'fscanf' so
this is bugs in code you have written and not included, so we can
obviously not correct it for you.

I would suggest that you look at line 869 and 874 of the file
'ionline.c'.

..............................................................................................................
Actually sir, on these lines there are simple system and fscanf functions are 
there...which are perfectly working on normal codes...!!! but here in  this 
code when I am using inside this mib2c generated  code it's not working !!
The code is below... which is working as a stand alone...but not with this 
code... 
When i am starting subagent  wit "net-snmp-config --compile-subagent ionline 
ionline.c"
Its showing following warnings..And so qgentX is not starting over here !!
Infect any of the function which returns a lavue..like system call..are not 
working inside the code 


FILE *pipe = NULL;
        char buffer[100];
        int j,k;

        system("sh jatin.sh > jatin.txt");

        pipe=fopen("jatin.txt", "r");

        j=fscanf(pipe,"%d",&i);

warning: ignoring return value of 'system', declared with
> attribute warn_unused_result [-Wunused-result]
warning: ignoring return value of 'fscanf', declared with
> attribute warn_unused_result [-Wunused-result]


How can I resolve this problem? I have to make a system call from getting some 
values from system,so I can assign them with different OIDS.

Thanks.





------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to