From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) by sourceware.org (Postfix) with ESMTPS id 314A63858D3C for ; Tue, 20 Feb 2024 14:49:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 314A63858D3C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 314A63858D3C Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708440541; cv=none; b=t1nhtpiwzzSrlsuLaMMoq+gHkvNyP4zLBT3/9W3wOgOM+LHBnsBbWj6U5KBS3sL4aygevjAZFaR9zIW/nhzzUp91+kPNj5oVDBmqRCiczFTRZCyK4sVt252vqT0EV+iA/JjTeSpKcjsPWk+B56HarBb3iJzKbTIaDpIaJVxSNvg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708440541; c=relaxed/simple; bh=Dp2w52aNvRPjiOijt/ZMuYI2XT8Qqr6Q1Cose7heUAA=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature: Message-ID:Date:MIME-Version:Subject:To:From; b=ils65R5psvdcPIOkeFnn/FJcyhb47V2TwuFb222G2P+wxbY0MBPVh5Srx3VcRAuYKBbUgejWykyrkLXw1YJmeqUh91D/yjvnNwFVtJqg6RCgcsi3tFpH3bdnSZ3sfudlGO7ei41B2LC5J9mMV4wU0scUeMjNJrME5sDeVqDy+GE= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 113672208F; Tue, 20 Feb 2024 14:48:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1708440539; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=w+L1Z85M8Zyu08bB+V7HUOO8Txhsy++w00dN79y+eZw=; b=2CR85G82VVR0rbGEiC4midVvd5Y0RFOtHzSUqcRMQfbjSipYI/ecvHBMvsm10ya4yiNdbi pIptxK7LdLTuFO+x4F3ctyoAeEGDzPY0z2hUkTr6VEMqKqzFzi+v/TaRQbXCM965xHgsjz Yoq5Hs/YceHVRdDCpuiD5H3sGnt4wVI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1708440539; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=w+L1Z85M8Zyu08bB+V7HUOO8Txhsy++w00dN79y+eZw=; b=2UOO5M/8Uo8aTLGEN3gcIC3fPb/27VfuXlU6JcCfyQd+GfpzDOzIWRmOWnRVSJfWy2MyBM Wdum7bDjr6rwFODQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1708440539; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=w+L1Z85M8Zyu08bB+V7HUOO8Txhsy++w00dN79y+eZw=; b=2CR85G82VVR0rbGEiC4midVvd5Y0RFOtHzSUqcRMQfbjSipYI/ecvHBMvsm10ya4yiNdbi pIptxK7LdLTuFO+x4F3ctyoAeEGDzPY0z2hUkTr6VEMqKqzFzi+v/TaRQbXCM965xHgsjz Yoq5Hs/YceHVRdDCpuiD5H3sGnt4wVI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1708440539; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=w+L1Z85M8Zyu08bB+V7HUOO8Txhsy++w00dN79y+eZw=; b=2UOO5M/8Uo8aTLGEN3gcIC3fPb/27VfuXlU6JcCfyQd+GfpzDOzIWRmOWnRVSJfWy2MyBM Wdum7bDjr6rwFODQ== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id EAC38139D0; Tue, 20 Feb 2024 14:48:58 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id RuiIN9q71GUqPAAAD6G6ig (envelope-from ); Tue, 20 Feb 2024 14:48:58 +0000 Message-ID: Date: Tue, 20 Feb 2024 15:48:51 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/5] Introduce new overload of read_text_file_to_string Content-Language: en-US To: Tom Tromey Cc: gdb-patches@sourceware.org References: <20240216-py-simple-exc-v1-0-c275bcfb5e4a@adacore.com> <20240216-py-simple-exc-v1-1-c275bcfb5e4a@adacore.com> <01e650fd-3a6c-4e2b-bf17-d0e89f19070b@suse.de> <874je3449j.fsf@tromey.com> From: Tom de Vries In-Reply-To: <874je3449j.fsf@tromey.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Authentication-Results: smtp-out1.suse.de; none X-Spam-Level: X-Spam-Score: -2.00 X-Spamd-Result: default: False [-2.00 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; XM_UA_NO_VERSION(0.01)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; BAYES_HAM(-0.71)[83.49%]; MIME_GOOD(-0.10)[text/plain]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; RCPT_COUNT_TWO(0.00)[2]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] X-Spam-Status: No, score=-6.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 2/20/24 15:08, Tom Tromey wrote: >>>>>> "Tom" == Tom de Vries writes: > > Tom> On 2/16/24 19:37, Tom Tromey wrote: >>> +/* Read the entire content of FILE into an std::string. */ >>> + >>> +extern std::string read_text_file_to_string (FILE *file); >>> + >>> #endif /* COMMON_FILESTUFF_H */ >>> > Tom> It occurred to me that if this reads the entire content of FILE, > Tom> shouldn't it start with an "fseek (file, 0, SEEK_SET)"? > > Tom> We could add an argument at_start that lets us skip the fseek, and > Tom> default it to false, and call it with at_start set to true from the > Tom> "const char *path" version of read_text_file_to_string. > > I'd rather not add things that we don't need. > How about I rename the function instead? Fine by me. Thanks, - Tom